ios 怎样让subview在最上层显示

2025-05-20 14:23:24
推荐回答(2个)
回答1:

  [self.view bringSubviewToFront:Btn];

回答2:

_parentView = nil;

NSArray* windows = [UIApplication sharedApplication].windows;
_window = [windows objectAtIndex:0];
//keep the first subview
if(_window.subviews.count > 0){
_parentView = [_window.subviews objectAtIndex:0];
}