Create a flash for the camera, in the navigation bar to customize the "flash" pattern, you want to change the picture when clicked, but has not changed, the original is because the global tint color, so the system will automatically change the color of the image to the global tint color.
Solution, when setting up the picture, add: Imagewithrenderingmode:uiimagerenderingmodealwaysoriginal
Source:
-(void) Setflashon: (BOOL) ison{ if (self.captureDevice.hasFlash) { uiimage* Flashlicon; [Self.capturedevice Lockforconfiguration:nil]; You must lock before setting torch mode if (isOn) { NSLog (@ "Set flash on"); [Self.capturedevice Setflashmode:avcaptureflashmodeon]; Flashlicon = [UIImage imagenamed:@ "flash_on"]; } else{ NSLog (@ "set flash off"); [Self.capturedevice Setflashmode:avcaptureflashmodeoff]; Flashlicon = [UIImage imagenamed:@ "Flash_off"]; } [Self.capturedevice unlockforconfiguration]; [Self.navigationItem.rightBarButtonItem Setimage:[flashlicon Imagewithrenderingmode: Uiimagerenderingmodealwaysoriginal]]; } else{ NSLog (@ "Sorry, this device doesn ' t has flash.");} }
Reference:
http://stackoverflow.com/questions/21252194/ Navigation-bar-button-item-image-color-is-different-when-design-through-xib-of-x