zoukankan      html  css  js  c++  java
  • 添加navbar以及上面的左右按钮代码

    UINavigationBar *navBar = [[UINavigationBaralloc] initWithFrame:CGRectMake(0, 0, 824, 44)];

        navBar.barStyle = UIBarStyleDefault;

        

        

        UINavigationItem *navItem = [[UINavigationItemalloc] init];

        navItem.leftItemsSupplementBackButton = YES;

        navItem.title = @"Add CRA";

        

        UIBarButtonItem *leftButton = [[UIBarButtonItemalloc] initWithTitle:@"Back"

                                                                       style:UIBarButtonItemStylePlain

                                                                      target:self

                                                                      action:@selector(back)];

        navItem.leftBarButtonItem = leftButton;

        

        UIBarButtonItem *rightButton = [[UIBarButtonItemalloc] initWithTitle:@"Done"

                                                                        style:UIBarButtonItemStylePlain

                                                                       target:self

                                                                       action:@selector(done)];

        navItem.rightBarButtonItem = rightButton;

        navBar.items = @[navItem];

        

        [self.view addSubview:navBar];

  • 相关阅读:
    第三次作业-有进度条圆周率计算
    第一周作业
    24点
    Cuber Sorting
    P1827 [USACO3.4]美国血统 American Heritage
    P4387 【深基15.习9】验证栈序列
    P2058 海港
    P4017 最大食物链计数
    P2196 挖地雷
    放苹果问题
  • 原文地址:https://www.cnblogs.com/sanjianghuiliu/p/3701062.html
Copyright © 2011-2022 走看看