Changing NavigationBar Title of UIImagePickerController

江枫思渺然 提交于 2019-11-29 14:15:00

I found the way to do it. When you set your UIImagePickerController delegate to self and implement the following method it worked.

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    [viewController.navigationItem setTitle:@""];
}

Found it from this link http://forums.macrumors.com/showthread.php?t=533216

Thanks...

This should allow you to set the title (the previous answer had a typo):

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    [viewController.navigationItem setTitle:@"Choose A Photo"];
}

Swift

IOS 8 || 9

func navigationController(navigationController: UINavigationController, willShowViewController viewController: UIViewController, animated: Bool) 
  {
    viewController.navigationItem.title = "video" // Change title
    imagePicker.navigationBar.tintColor = .whiteColor() //Text Color
    imagePicker.navigationBar.titleTextAttributes = [
        NSForegroundColorAttributeName : UIColor.whiteColor()
    ]

  }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!