您的位置:首页 > 移动开发 > IOS开发

ios11导航栏按钮不适配解决方法

2017-12-11 15:00 183 查看
 UIButton *leftbutton=[[UIButton alloc]initWithFrame:CGRectMake(0, 7, 30, 30)];

    

    UIView *containView = [[UIView alloc] initWithFrame:leftbutton.bounds];

    

    [containView addSubview:leftbutton];

  

    [leftbutton setImage:[UIImage imageNamed:@"but_Photograph_press"] forState:UIControlStateNormal];

    

    UIBarButtonItem *leftItem=[[UIBarButtonItem alloc]initWithCustomView:containView];

    

    self.navigationItem.leftBarButtonItem=leftItem;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: