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

 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;

猜你喜欢

转载自blog.csdn.net/u012960049/article/details/78772772