iPhone:如何设置UIViewController框架? [英] iPhone: How to set UIViewController frame?
本文介绍了iPhone:如何设置UIViewController框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个根UIViewController,我正在添加其他UIViewController作为子视图。目前,每个子视图都太低了(覆盖我的自定义构建标签栏)。当我尝试如下所示时,它不起作用:
I have a root UIViewController that I am adding other UIViewController's as subviews. Currently each of the subviews are too low down (covering up my custom build tabbar). When I try to so something like the following, it does not work:
// Test setting frame size to see if it works
self.view.frame = CGRectMake(0, 0, 200, 200);
这不会改变帧大小。
所以,我的问题是,在将UIViewController添加为子视图后,如何初始化UIViewController时如何设置框架?
推荐答案
@Nic我认为当你添加其他视图时,你应该定义其他视图框架大小如下:
@Nic i think when you are adding that other view, at that time you should define the other views frame size like this:
Someviewcontroller *c = initWithNibName
c.view.frame = CGRectMake(0, 0, 200, 200);
[self addSubView:c];
我不知道这是否有效但是就是这样。
i dont know if this will work but it is something like this.
这篇关于iPhone:如何设置UIViewController框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文