隐藏 uitabbar 时视图上的空白区域
我知道还有其他关于此问题的帖子,但它们似乎对我不起作用。当我的应用程序中的 uinavigationcontroller 推送特定视图时,我将视图旋转到横向模式并隐藏选项卡栏。但是,当选项卡栏隐藏而不是显示其后面的视图时,会显示空白区域。
为了解决此问题,我在 viewDidLoad 方法中使用了以下代码行,正如有关此问题的其他帖子所建议的那样,但并没有解决问题。
[self.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
如果有人知道发生了什么事,请帮忙。 谢谢,
I know there are other posts about this issue, but they don't seem to work for me. When a particular view is pushed by my uinavigationcontroller in my app, I rotate the view to landscape mode and hide the tabbar. however, when the tabbar hides instead of displaying the view behind it displays a blank white space.
To solve this I used the following line of code in my viewDidLoad method as suggested by other posts about this issue, but it didn't solve it.
[self.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
If anyone knows what's going on, please help.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该在视图中(无论是笔尖还是代码)将
setAutoresizingMask:
设置为UIViewAutoresizingFlexibleHeight
或UIViewAutoresizingFlexibleBottomMargin
(不确定哪一个)做这个伎俩。如果这不能解决您的问题,我猜您使用setHidden:
隐藏选项卡栏。尝试调用此方法。You should set
setAutoresizingMask:
in your view (whether in nib or code) toUIViewAutoresizingFlexibleHeight
orUIViewAutoresizingFlexibleBottomMargin
(don't sure which one) that should do the trick. In case this donesn't solved your problem I guess that you hide the tabbar by usingsetHidden:
. Try calling this instead.如果您的视图大小合适,请尝试调用 [self.view setNeedsDisplay]。当你改变大小时它应该做类似的事情,所以我不确定。
If your view is the right size then try calling [self.view setNeedsDisplay]. It should do something similar when you change the size though so I'm not sure.