Ber*_*rgP 6 iphone interface-builder uiviewcontroller uiview ios
在界面构建器中,UIViewController的UIView参数很少:topBar,bottomBar,...
界面构建器的视图参数
当我为Top Bar参数设置导航栏值并为Bottom Bar参数设置Tab栏时会发生什么?这对我非常有用.
那么,我怎么能以编程方式呢?
实际上,这个参数用于构建正确的界面,即使您在 Xcode Interface Builder 中设置这个栏,如果您没有在某些 UIViewController 容器中使用 UIViewController,它们也不会出现。
例如,如果您将 UIVIewController 添加到 UINavigationController 中,那么您将看到导航栏作为顶部栏。此模拟指标对程序没有影响,但如果您希望在容器内使用 UIViewController,它们将帮助您构建正确的界面。
但是,如果您想以编程方式在 UIViewController 中添加界面的这一部分,您可以使用相应的 subiews。例如:
UINavigationBar *yourBar = [[UINavigationBar alloc] init];
[self.view addSubview:yourBar];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4392 次 |
| 最近记录: |