【简单常用】nav view

隐藏系统的navgation


-(void)viewWillAppear:(BOOL)animated

{

    self.navigationController.navigationBar.hidden=YES;    

}





//随便怎么加,都可以,每页都得搞,有点累

- (void)viewDidLoad {

    [super viewDidLoad];


    UIView*nav_view=[[UIView alloc]initWithFrame:CGRectMake(0, 20, self.view.bounds.size.width, 44)];

    nav_view.backgroundColor=[UIColor blackColor];


    UIButton*dl_button=[[UIButton alloc]initWithFrame:CGRectMake(20, 7, 40, 30)];

    [dl_button setTitle:@"登陆" forState:UIControlStateNormal];

    dl_button.titleLabel.font=[UIFont boldSystemFontOfSize:20];

    [dl_button addTarget:self action:@selector(dl) forControlEvents:UIControlEventTouchUpInside];

    [nav_view addSubview:dl_button];

    

    UILabel*nav_label=[[UILabel alloc]initWithFrame:CGRectMake(self.view.bounds.size.width/2-50, 7, 100, 30)];

    nav_label.text=@"竟然没标题";

    nav_label.textAlignment=NSTextAlignmentCenter;

    nav_label.textColor=[UIColor whiteColor];

    [nav_view addSubview:nav_label];

    

    UIButton*ss_button=[[UIButton alloc]initWithFrame:CGRectMake(self.view.bounds.size.width-100, 7, 40, 32)];

    [ss_button setImage:[UIImage imageNamed:@"spotlight-blue-button"] forState:UIControlStateNormal];

    [nav_view addSubview:ss_button];

    

    UIButton*tj_button=[[UIButton alloc]initWithFrame:CGRectMake(self.view.bounds.size.width-50, 7, 40, 32)];

    [tj_button setImage:[UIImage imageNamed:@"plus_2"] forState:UIControlStateNormal];

    [nav_view addSubview:tj_button];

    

    [self.view addSubview:nav_view];

    

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值