ios导航栏又按钮添加图片后使其保持原色

时间:2023-12-18 15:58:38

UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:self action:@selector(addItemmmClick)];

self.navigationItem.rightBarButtonItem = rightBarItem;

[self.navigationItem.rightBarButtonItem setImage:[[UIImage imageNamed:@"nav_add"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];