UINavigationController 操作记录

      //设置字体大小 颜色

    {

        UIColor *color = [UIColor brownColor];

        UIFont * font = [UIFont systemFontOfSize:20];

        NSDictionary * dict = [NSDictionary dictionaryWithObjects:@[color,font] forKeys:@[NSForegroundColorAttributeName ,NSFontAttributeName]];

        self.navigationController.navigationBar.titleTextAttributes = dict;

    }

    

    //设置左右按钮

    {

        UIBarButtonItem * leftBtn = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"leftBarItem"] style:UIBarButtonItemStyleDone target:self action:@selector(leftClicked)];

        [self.navigationItem setLeftBarButtonItem:leftBtn];

        

        UIBarButtonItem * rightBtn = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"rightBarItem"] style:UIBarButtonItemStyleDone target:self action:@selector(rightClicked)];

        [self.navigationItem setRightBarButtonItem:rightBtn];

 

    }

    //设置背景颜色

    {

        [self.navigationController.navigationBar setBarTintColor:[UIColor orangeColor]];

    }

posted on 2015-08-12 16:24  景树园  阅读(143)  评论(0)    收藏  举报

导航