代码改变世界

iOS - UIBarbuttonitem图片是蓝色

2017-08-26 09:22  菜鸟Alex  阅读(1495)  评论(0编辑  收藏  举报
  • 一行代码搞定
    UIImage *selectedImage=[UIImage imageNamed: @"add2"];
    selectedImage = [selectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIBarButtonItem * btnAdd = [[UIBarButtonItem alloc] initWithImage:selectedImage style:UIBarButtonItemStylePlain target:self action:@selector(clickAdd)];