选择了tableView的某一行后以modal的方式跳转的到子控制器,以及子控制器导航栏左上角"关闭"按钮

来源:互联网 发布:拍照姿势的软件 编辑:程序博客网 时间:2024/05/16 20:33
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{       KDHtmlViewController *html = [[KDHtmlViewController alloc]init];        KDNavigationController *nav = [[KDNavigationController alloc]initWithRootViewController:html];        [self presentViewController:nav animated:YES completion:nil];}

子控制左上角"关闭"按钮

- (void)viewDidLoad {    [super viewDidLoad];    // Do any additional setup after loading the view.           //设置左上角的『关闭』按钮    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"关闭" style:UIBarButtonItemStylePlain target:self action:@selector(colse)];}- (void)close{    [self dismissViewControllerAnimated:YES completion:nil];}


0 0