IOS 修改navigationItem的按钮

       UIBarButtonItem *myButton = [[UIBarButtonItem alloc]
                                      initWithTitle:@"myButton"
                                      style:UIBarButtonItemStylePlain
                                      target:self
                                      action:@selector(action)];
   //  self.navigationItem.leftBarButtonItem = myButton;
    self.navigationItem.rightBarButtonItem = myButton;
   //  self.navigationItem.backBarButtonItem = myButton;

navigationItem有以下成员可以设置的成员:

-title

-titleview

-backBarButtonItem//这是有返回上一级事件的后退按钮

-rightBarButtonItem

-leftBarButtonItem


你可能感兴趣的:(ios,NavigationItem)