iphone sdk uitabbarcontroller 不起作用
我正在尝试创建 3 个 Tabbar 控件,但第三个不显示页面,有人知道代码有什么问题吗?提前致谢。
FirstViewController* viewController1 = [[FirstViewController alloc]init];
MySecondViewController* viewController2 = [[MySecondViewController alloc]init];
MyThirdViewController* viewController3 = [[MyThirdViewController alloc]init];
NSArray* controllersArray = [NSArray arrayWithObjects:viewController1, viewController2, viewController3, nil];
tabController = [[UITabBarController alloc]init];
[tabController setViewControllers:controllersArray];
[viewController1 release];
[viewController2 release];
[viewController3 release];
I'm trying to create 3 Tabbar control but the third one does not display the page, anyone know what's wrong with the code? Thanx in advance.
FirstViewController* viewController1 = [[FirstViewController alloc]init];
MySecondViewController* viewController2 = [[MySecondViewController alloc]init];
MyThirdViewController* viewController3 = [[MyThirdViewController alloc]init];
NSArray* controllersArray = [NSArray arrayWithObjects:viewController1, viewController2, viewController3, nil];
tabController = [[UITabBarController alloc]init];
[tabController setViewControllers:controllersArray];
[viewController1 release];
[viewController2 release];
[viewController3 release];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于没有提供其他代码,我举一个例子。扩展您的类,使用 UITabBarController 随意命名它。然后在你的 UITabBarController 子类中做这样的事情。
然后你只需在上面列出的三个类中设置文本和 tabbarimage 即可。
一个例子是:
Since no other code is provided, I give you an example. Extend your class, call it whatever you want with UITabBarController. Then in your UITabBarController subclass do something like this.
Then you just have to set up the text and tabbarimage in the three classes listed above.
An example would be: