Hiding UINavigationItem's bar button

后端 未结 11 990
粉色の甜心
粉色の甜心 2021-01-04 07:04

I have added a BarButton item to the left of the nav.bar through Interface Builder and in the code I want this only to show in my table view\'s edi

11条回答
  •  攒了一身酷
    2021-01-04 07:26

    This solution work for me

    UIView *myView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, 300, 30)];
    UIBarButtonItem *btnL = [[UIBarButtonItem alloc]initWithCustomView:myView];
    self.navigationItem.leftBarButtonItem = btnL;
    

提交回复
热议问题