How to change cancel button title in UIImagePickerController?

前端 未结 6 1498
再見小時候
再見小時候 2021-01-15 06:46

Currently I\'m working on a multi-language application and I want to change the Cancel ,Use and Retake button titles of the UIIm

6条回答
  •  有刺的猬
    2021-01-15 07:02

    Just find and change text of UIButton

    -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
        {
            for (UIView *v in viewController.view.subviews)
            {
                if ([v isKindOfClass:[NSClassFromString(@"CMKBottomBar") class]])
                {
                    SEL se = NSSelectorFromString(@"cancelButton");
    
                    if ([v respondsToSelector:se])
                    {
                        UIButton *cancelButton =  [v performSelector:se];
                        [cancelButton setTitle:@"New title" forState:UIControlStateNormal];
                    }
    
                }
            }
        }
    

提交回复
热议问题