Pramod More
Pramod More

Reputation: 1250

Navigation bar becomes transparent

navigation bar transparent while picking a video from image picker controller

enter image description here

I'm trying to pick a video using image picker controller. while picking a video, previous screen title is visible or navigation bar is transparent. This is only happening on iPad, not on iPhone. My code is as given,

    imagePicker.sourceType = .savedPhotosAlbum
    imagePicker.mediaTypes = [kUTTypeMovie as String]
    self.present(self.imagePicker, animated: true, completion: nil)

Upvotes: 1

Views: 515

Answers (2)

iAmrSalman
iAmrSalman

Reputation: 621

I think there is value in UINavigationBar's Appearance you can remove it by putting this line before you present your UIPickerView

UINavigationBar.appearance().barTintColor = nil

if you want to put the value back after user picked image/video you can do it in UIImagePickerControllerDelegate function imagePickerController(_:didFinishPickingMediaWithInfo:) and also in imagePickerControllerDidCancel(_:)

UINavigationBar.appearance().barTintColor = UIColor.red

Upvotes: 1

Pratik
Pratik

Reputation: 726

if you want to make navigation bar transparent while scrolling you need to set colour when you pickerview 1) appears 2) is scrolling 3) and has selected an item. Here is the link. I hope that answers you question.

Upvotes: 0

Related Questions