In ios, the text of the button on the UIImagePickerController page is changed to Chinese.
Today, we call the system's photo taking and local album editing functions, but the buttons are all in English. I want to change them to Chinese to cancel, select, and repeat.
Two methods need to be changed
1. On the UIImagePickerController page, change the Cancel and Choose buttons as well as the repeat button in the screenshot to Chinese.
I was going to set it by getting the pointer of these buttons, and finally found that you can directly add a simplified Chinese character to the project --> info --> Localization ---> language in the project.
Reference: http://www.cocoachina.com/bbs/read.php? Tid = 132828
2. There are methods for customization.
First, recursively traverse the hierarchy of the self. view until the view is found and Its pointer is obtained for operation.
-(UIView *) findView :( UIView *) aView withName :( NSString *) name {Class cl = [aView class]; NSString * desc = [cl description]; if ([name isEqualToString: desc]) return aView; for (UIView * view in aView. subviews) {Class cll = [view class]; NSString * stringl = [cll description]; if ([stringl isw.tostring: name]) {return view ;}} return nil ;} -(void) addSomeElements :( UIViewController *) viewController {UIView * PLCameraView = [self findView: viewController. view withName: @ "blank"]; UIView * PLCropOverlay = [self findView: PLCameraView withName: @ "PLCropOverlay"]; UIView * bottomBar = [self findView: PLCropOverlay withName: @ "PLCropOverlayBottomBar"]; UIImageView * bottomBarImageForSave = [bottomBar. subviews objectAtIndex: 0]; UIButton * retakeButton = [bottomBarImageForSave. subviews objectAtIndex: 0]; [retakeButton setTitle: @ "replaying" forState: UIControlStateNormal]; UIButton * useButton = [bottomBarImageForSave. subviews objectAtIndex: 1]; [useButton setTitle: @ "save" forState: UIControlStateNormal]; UIImageView * bottomBarImageForCamera = [bottomBar. subviews objectAtIndex: 1]; UIButton * cancelButton = [bottomBarImageForCamera. subviews objectAtIndex: 1]; [cancelButton setTitle: @ "cancel" forState: canceled];}-(void) navigationController :( UINavigationController *) navigationController willShowViewController :( UIViewController *) viewController animated :( BOOL) animated {[self addSomeElements: viewController];}
|
Ios developers use UIImagePickerController to call the camera to get the button in the camera? Points
You are calling to take a photo.
Use the takePicture Method
That's all.
How does UIImagePickerController add click events?
UIImagePickerController is defined by the system. What effect does the landlord want to achieve?