Ahm*_*zaz 5 swift ios11 uidocumentpickerviewcontroller
我在iOS 11的UIDocumentPicker导航栏中发现了一个问题,完成,取消或编辑按钮是不可见的,当用户触摸它时,它会出现即正常状态下的颜色为白色,即使在更改时也是如此UINavigationBar.appearnce().tintColor,仅颜色触摸后改变了.
使用带有黑色的CustomDocumentPickerViewControllerappearance和UINavigationBarUIBarButtonItem
import UIKit
class CustomDocumentPickerViewController: UIDocumentPickerViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UINavigationBar.appearance().tintColor = UIColor.black
UIBarButtonItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName : UIColor.black], for: .normal)
}
override func viewWillDisappear(_ animated: Bool) {
UINavigationBar.appearance().tintColor = UIColor.white // your color
UIBarButtonItem.appearance().setTitleTextAttributes(nil, for: .normal)
super.viewWillDisappear(animated)
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
816 次 |
| 最近记录: |