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

来源:互联网 发布:seo和dsp 编辑:程序博客网 时间:2024/05/29 15:35
 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;
阅读全文
0 0
原创粉丝点击