FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(tab-view): Title and icon positioning by vakrilov · Pull Request #6362 · NativeScript/NativeScript · GitHub

fix(tab-view): Title and icon positioning - #6362

Merged
vakrilov merged 3 commits into
masterfrom
tab-title-vertical-align
Oct 8, 2018
Merged

vakrilov merged 3 commits into
masterfrom
tab-title-vertical-align

Conversation

vakrilov commented Oct 5, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

By guidelines TabViewItems usually have icon and title and IOS positions them correctly: either side-by-side or icon above the title depending on form factor, IOS version and orientation.

Here is how icon/text are positioned in different IOS version/device/orientation combinations:

IOS 11 Portrait Landscape
Phone icon above title side by side
Tablet side by side side by side
IOS 9/10 Portrait Landscape
Phone icon above title icon above title
Tablet icon above title icon above title

In the icon above title cases, when only one of them (icon or title), IOS leaves space for the other. That why we have to either move the title a bit up or the icon a bit down so that it is vertically centered.

In IOS version before 11, the icon is always above the title so we did the adjustment every time. However, in 11 icon is above title only for phones in portrait mode. This fix handles this case.

There is a test page in the ui-test-app -> tab-view-icon-title-placement cc @SvetoslavTsenov

Fixes #3402

vakrilov requested a review from MartoYankov October 5, 2018 10:37
ghost assigned vakrilov Oct 5, 2018
ghost added the in progress label Oct 5, 2018
ns-bot added the cla: yes label Oct 5, 2018
const orientation = controller.interfaceOrientation;
const isPortrait = orientation !== UIInterfaceOrientation.LandscapeLeft && orientation !== UIInterfaceOrientation.LandscapeRight;
const isIconAboveTitle = (majorVersion < 11) || (isPhone && isPortrait);
console.log(`UPDATING tabItem: ${tabItem.title} --- isPortrait:${isPortrait}, isPhone:${isPhone}, version: ${majorVersion}, isIconAboveTitle: ${isIconAboveTitle}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Remove the console.log or do it as a trace?

ghost added the in progress label Oct 5, 2018

vakrilov commented Oct 7, 2018

Copy link
Copy Markdown
Contributor Author

test

vakrilov merged commit e3d5f0d into master Oct 8, 2018
vakrilov deleted the tab-title-vertical-align branch October 8, 2018 08:23
ghost removed the in progress label Oct 8, 2018

MCorzo commented Jun 14, 2019

Copy link
Copy Markdown

Hi, this issue is still in progress? I'm working with TabView in iOS and the problem is still present... I'm checking the different NS repository and the bug was reported a long time ago, any help I can give??

vakrilov commented Jun 17, 2019 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

It will be best to open a new issue about it (with repro and screenshot) as it might be a different issue.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TabView title is not vertically centered on IOS when there is no icon

5 participants


Back | FazBrowse Home | New Git URL