删除uiwindow的子视图? [英] remove subview of uiwindow?
本文介绍了删除uiwindow的子视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从uiwindow中删除一个视图,所以我在appdelegate方法中使用nslog,它说窗口的子视图数为两个NSLog(@" %d",[[self.window subviews] count]);
,所以如何从窗口中删除该子视图,如果我删除了该子视图,我可以使用选项卡栏控制器继续...
i want to remove a view from uiwindow,so i nslog in appdelegate method,it says window's subviews count as two NSLog(@" %d",[[self.window subviews] count]);
so how can i remove that subviews from window,if i remove that subviews i have tab bar controller to be continued...
- (void) GetUserCompleted
{
NSLog(@" %@",[[self.window subviews] objectAtIndex:0]);
NSLog(@" %@",[[self.window subviews] objectAtIndex:1]);
}
推荐答案
您可以使用以下代码删除单个子视图.
You can remove the a single subview using the following code.
[subview_Name removeFromSuperview];
如果要从视图中删除所有子视图,请使用它.
if you want to remove all subviews form the view then use this.
NSArray *subViewArray = [self.window subviews];
for (id obj in subViewArray)
{
[obj removeFromSuperview];
}
这篇关于删除uiwindow的子视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文