Objective c UITableView更改样式
我有一个uitableView,其中包含我以编程方式创建的不同节和行 当我点击一行时,我将进入新视图,在导航栏的新视图中,我有canel按钮 使用“取消”按钮时,它应该像“后退”按钮一样工作,但当我单击“取消”时,它会加载表格,但会将表格样式从“组”更改为“普通” 提前谢谢 有人知道为什么吗 你能帮帮我吗 我想知道它为什么会改变。 我应该添加什么才能拥有相同的样式 这是我的密码: 在第一个表中,我通过编程和故事板添加了样式Objective c UITableView更改样式,objective-c,ios,uitableview,storyboard,Objective C,Ios,Uitableview,Storyboard,我有一个uitableView,其中包含我以编程方式创建的不同节和行 当我点击一行时,我将进入新视图,在导航栏的新视图中,我有canel按钮 使用“取消”按钮时,它应该像“后退”按钮一样工作,但当我单击“取消”时,它会加载表格,但会将表格样式从“组”更改为“普通” 提前谢谢 有人知道为什么吗 你能帮帮我吗 我想知道它为什么会改变。 我应该添加什么才能拥有相同的样式 这是我的密码: 在第一个表中,我通过编程和故事板添加了样式 - (id)initWithStyle:(UITableViewStyl
- (id)initWithStyle:(UITableViewStyle)style
{
style = UITableViewStyleGrouped;
self = [super init];
if (self) {
self = [super initWithStyle:style];
monthTitle = [[NSMutableArray alloc] init];
}
return self;
}
按钮代码
-(void)cancelItem{
Report *report = [[Report alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:report animated:YES];
[self.tableView reloadData];
}
编辑
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
_selectedIndex = indexPath.section;
[self.tableView reloadData];
switch (indexPath.section){
case 0:
[self performSegueWithIdentifier:@"WorkTime" sender:self];
我们可以将样式设置为
[[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped];
如何显示第二个表?@janufidel-(void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(nsindepath*)indepath{u selectedIndex=indepath.section;[self.tableView reloadData];switch(indepath.section){case 0:[self performsguewithidentifier:@“WorkTime”发送方:self]@Janusfiel我在上面添加了编辑功能。您是否使用导航控制器推送新视图???