Closed TimAEllis closed 4 years ago
Hey @Fudge0952,
Thanks for opening up an issue for WhatsNewKit 🙌
Sadly the layout isn't currently optimized for landscape orientation on iOS.
This is definitely a task on the road map for the next release of WhatsNewKit. I was also thinking about implementing a scroll behaviour that is identical to the UINavigationController with large titles.
Please feel free to open up a PR if you have any ideas on how to improve the layout of the WhatsNewViewController
👌
Hey @SvenTiigi,
I'll definitely do some experimentation using large titles to see if we can benefit from it. I'll keep you updated with what I discover 😉
So I was doing some experimentation and in order to support large titles, it would require some reworking of how the views are laid out. Right now the title view, content view, and button view are all separate views, so in order to support shrinking the title when the user scrolls, we would need to modify the layout completely so that the table view and title are together (to avoid nasty hacking with on scroll events). If we wanted to use the built-in "prefers large titles", it would mean bumping the minimum version to iOS 11 (not sure if that's something you're wanting to do. Alternatively, you could include the title as the first cell of the items table view and when it is scrolled out of view, you update the navigation title with the title label's text (and hide it when it comes into focus). This has the potential to limit the customisation of the title layout (unless you still customise it as a child cell of the items table view).
What are your thoughts on all this @SvenTiigi?
Hi @SvenTiigi, I had attempted to add an option to allow the title to scroll with the items. The related pull request is here. Let me know what you think :)
-- Tim
Hi @Fudge0952,
sorry I totally forgot about this issue 🙈 My fault 😃
The PR looks good. Great work 👍
I will open up a new feature branch to merge your PR 👌
Hey @Fudge0952,
your PR has been merged and is now available within the new release 1.3.2
of WhatsNewKit 👍
For a better consistency I've moved the titleMode
property to the TitleView
configuration.
In default the TitleView is sticked to the top.
If you wish that the TitleView scrolls with the ItemsView you can change the titleMode
on the TitleView configuration.
// TitleView scrolls alongside with the ItemsView
configuration.titleView.titleMode = .scrolls
// TitleView is fixed to top
configuration.titleView.titleMode = .fixed
☝️ In default the titleMode is set to
.fixed
.
Excellent, no worries at all. Wasn’t too sure where you wanted the property so I made a guess 😝
WhatsNewKit Environment
What did you do?
What did you expect to happen?
What happened instead?
Perhaps this could be a general improvement to pan the title like how the "large titles" work in navigation controllers? I'm not sure if there was a reasoning behind making it static? I've attached a screenshot of the layout in landscape mode below