【发布时间】:2011-05-06 05:15:40
【问题描述】:
我在我的项目中添加了一个新文件,因为我正在以编程方式创建屏幕,并且我使用以下代码创建了一个带有标题栏和标题栏上的 2 个按钮的分组表视图,但它只创建了分组表而不是标题栏是这样的,谁能帮我提前谢谢
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Add Item";
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self action:@selector(cancel_Clicked:)] autorelease];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemSave
target:self action:@selector(save_Clicked:)] autorelease];
self.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 320, 415)style:UITableViewStyleGrouped];
tableView.dataSource = self;
tableView.delegate = self;
[self.view addSubview:tableView];
}
【问题讨论】:
标签: iphone objective-c titlebar