一种设置我的UIViewController大小的方法

0 objective-c uiviewcontroller

大家好,我想知道是否有办法为UIViewcontroller创建某种框架

比如像(我知道它不起作用):

  UIViewController *example = [[UIViewController alloc]  
initWithFrame:CGRectMake(0, 0, 320 , 55)];
Run Code Online (Sandbox Code Playgroud)

有点像UIWebview

 UIWebView *aWebView = [[UIWebView alloc] 
initWithFrame:CGRectMake(0, 0, 320 , 100)];
Run Code Online (Sandbox Code Playgroud)

如果有人有想法,我真的很想知道.

Vla*_*mir 5

您应该设置控制器的视图框架:

example.view.frame = CGRectMake()
Run Code Online (Sandbox Code Playgroud)