zoukankan      html  css  js  c++  java
  • navigationController背景图,文字,事件定义

    //设置背景图片

    [self.navigationController.navigationBar setBackgroundImage:imag forBarMetrics:UIBarMetricsDefault];

    //button 定义你要的背景 文字 或 事件

     UIBarButtonItem *leftBarButton = [[UIBarButtonItem alloc] initWithCustomView:button];

     self.navigationItem.leftBarButtonItem = leftBarButton;

     [leftBarButton release];

    具体实现:

    [self.navigationItem setTitle:@"通知详情"];

        //self.navigationController.navigationBarHidden = NO;

        [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"root_top.png"] forBarMetrics:UIBarMetricsDefault];

        self.navigationItem.hidesBackButton = YES;

        

        UIButton *rightButton = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 70, 10, 70, rootTopHeight - 20)];

        [rightButton addTarget:self action:@selector(NoticeBackAction) forControlEvents:UIControlEventTouchUpInside];

        [rightButton setBackgroundImage:[UIImage imageNamed:@"root_back.png"] forState:UIControlStateNormal];

        [rightButton setTitle:@"退出" forState:UIControlStateNormal];

        UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc]initWithCustomView:rightButton];

        self.navigationItem.rightBarButtonItem = rightBarButton;

  • 相关阅读:
    推销员问题
    string类实现
    链表倒数第k个节点
    设计模式之单例模式大全
    空类 sizeof 为什么是1
    类的三种继承方式
    单例模式典型创建方法(三种)
    虚函数实现
    链表删除结点
    TCP的状态转移
  • 原文地址:https://www.cnblogs.com/littlewrong/p/4909015.html
Copyright © 2011-2022 走看看