Is there any way to change the iOS Large Title left margin?
Asked Answered
A

1

7

I would like to know if is there any way to change the iOS Large Title left margin property. I tried to find the answer for it on the web, but I did not succeed.


Extra question: is the default margin between items and the horizontal sides of the screen 15? The reason I am asking this is because I am trying to align the large title with the rest of the elements of my app, that has 15 left/right margin to the screen.

Thank you :)

Audiology answered 5/7, 2018 at 9:53 Comment(0)
E
9

You can do something like this:

let style = NSMutableParagraphStyle()
style.firstLineHeadIndent = 10 // This is added to the default margin
UINavigationBar.appearance().largeTitleTextAttributes = [NSAttributedString.Key.paragraphStyle : style]

Assuming that the 'rest of the elements' in your 'extra question' are tableview items, then yes, 15 seems to be a default margin: Why UITableView cell separatorInset is default to 15, when view controller's root view Layout Margins is 16?

Emmetropia answered 16/9, 2018 at 15:22 Comment(1)
This work on iOS 12, but on iOS 11 it cuts the tail of the title of. Any solution for iOS 11?Gothurd

© 2022 - 2024 — McMap. All rights reserved.