UITabBarController 未出现在视图中
我有一个 UIView,它正在推送包含在 UITabBarController 内部的 UITableViewController。
#import <UIKit/UIKit.h>
@interface ARViewController : UITableViewController<UITabBarControllerDelegate> {
IBOutlet UITabBarController* tabBarController;
}
@property(nonatomic,retain)IBOutlet UITabBarController* tabBarController;
@end
这是我的实现,
- (void)viewDidLoad {
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
self.clearsSelectionOnViewWillAppear = NO;
self.title = @"AR";
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
tabBarController.delegate = self;
[self.view addSubview:tabBarController.view];
}
我的 UITabBarController 引用了文件所有者。为什么没有出现?
I have a UIView that is pushing a UITableViewController that is contained inside of a UITabBarController.
#import <UIKit/UIKit.h>
@interface ARViewController : UITableViewController<UITabBarControllerDelegate> {
IBOutlet UITabBarController* tabBarController;
}
@property(nonatomic,retain)IBOutlet UITabBarController* tabBarController;
@end
Here is my implementation
- (void)viewDidLoad {
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
self.clearsSelectionOnViewWillAppear = NO;
self.title = @"AR";
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
tabBarController.delegate = self;
[self.view addSubview:tabBarController.view];
}
My UITabBarController is referenced to Files Owner. Why is it not appearing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UITabBarController 始终用作“根控制器”。也许您可以尝试使用根控制器来包含表视图。将选项卡栏作为子视图添加到表视图中并不是常见的方法。
UITabBarController is always used as 'root controller'. Maybe you can try to use a root controller to contain a tableview. And it's not a common method to add a tabbar as a subview to a tableview.