preferslargetitles

How to create a left aligned title with prefersLargeTitles in navigationBar?

巧了我就是萌 提交于 2021-02-08 10:40:34
问题 I'm using prefersLargeTitles on my navigation bar, When it collapse, I want to align the title to the left of the navigation bar, What I did is I create a leftBarButtonItem with a custom view of label and set the title color to .clear , the problem is, that label is visible even if the large titles didn't collapsed yet. This is my code for adding navigation item as my title let label = UILabel() label.textColor = UIColor.black label.text = "my left title" self.navigationItem.leftBarButtonItem

How to convert Navbar Large title to Multi-line, centre aligned

时光怂恿深爱的人放手 提交于 2020-07-19 04:44:29
问题 I'm trying to design view controller with Multi-lined centred Large title text exactly like Ask Siri by apple ( Settings->General->Keyboards->About Ask Siri, Dictation and Privacy... ). I can able to achieve centred text using: let paragraph = NSMutableParagraphStyle() paragraph.alignment = .center navigationController?.navigationBar.largeTitleTextAttributes = [.paragraphStyle: paragraph] I did set Navigation title from Storyboard and tried these to achieve multi-lined large title: https:/

Remove 1px line at top of UISearchController in large titles UINavigationBar

一曲冷凌霜 提交于 2019-12-04 19:09:39
问题 I'm transitioning from a view with a large style UINavigationItem into a view that has a large style UINavigationItem and a UISearchController . I've customized the background colour of the UINavigationBar . For some reason, there's a 1px line or space between the UINavigationBar and the UISearchController . I can tell it's from the NavigationBar , because if I scroll so that the search bar sticks to the top, the line disappears. I'm just not sure what's generating this line. I'm not using