TabView icons (title) using icon fonts on iOS are not vertically centered
See original GitHub issuePlease, provide the details below:
Did you verify this is a real problem by searching [Stack Overflow]
Yes, I had previously created an issue where icon fonts were not working on iOS TabView titles. https://github.com/NativeScript/NativeScript/issues/4302 It got resolved with 3.2.0 but here is a minute issue with it.
Tell us about the problem
The TabView icons using icon fonts on iOS are not vertically centered, on Android it is vertically centered and looks good, but on iOS it is aligned to the top.
Which platform(s) does your issue occur on?
iOS
Please provide the following version numbers that your issue occurs with:
- CLI: 3.2.0
- Cross-platform modules: 3.2.0
- Runtime(s):
"tns-ios": {
"version": "3.2.0"
},
"tns-android": {
"version": "3.2.0"
}
- Plugin(s): Not using a plugin but making use of Material Icons (icon font)
Please tell us how to recreate the issue in as much detail as possible.
Create a tab view with title using Material Icons (Icon font) and you will be able to see the title icons are not vertically centered.
On iOS
On Android
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
<TabView class="tabview-look" style="font-size: 23;" selectedTabTextColor="#990000" loaded="mainContentLoaded" id="tabView1">
<TabView.items>
<TabViewItem title="" >
<TabViewItem.view>
<notifications:notifi />
</TabViewItem.view>
</TabViewItem>
<TabViewItem title="" >
<TabViewItem.view>
<requests:request />
</TabViewItem.view>
</TabViewItem>
<TabViewItem title="" >
<TabViewItem.view>
<label text="Check calendar" horizontalAlignment="center" class="size16b" extwrap="true"/>
</TabViewItem.view>
</TabViewItem>
<TabViewItem title="" >
<TabViewItem.view>
<label text="Ask Questions" horizontalAlignment="center" class="size16b" extwrap="true"/>
</TabViewItem.view>
</TabViewItem>
<TabViewItem title="" >
<TabViewItem.view>
<label text="Recent updates go here" horizontalAlignment="center" class="size16b" textwrap="true"/>
</TabViewItem.view>
</TabViewItem>
</TabView.items>
</TabView>
.tabview-look {
background-color: #fff;
font-family: MaterialIcons, Material Icons;
}
.size16b {
font-size: 13.5;
margin-left: 13px;
margin-top: 3.75px;
margin-bottom: .25px;
color: #212121;
font-weight : bold;
font-family: 'Open Sans', sans-serif;
}
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (4 by maintainers)
Top Results From Across the Web
TabView icons (title) using icon fonts on iOS are not vertically ...
The TabView icons using icon fonts on iOS are not vertically centered, on Android it is vertically centered and looks good, but on...
Read more >Why is are my title in my Bottom.Tab not vertically centered?
The thing here is that the bottomTabNavigator expect an icon for each tab, if you don't want to usa an icon you can...
Read more >Positioning UITabBarItem's image | Apple Developer Forums
I want to position the image of a UITabBarItem with the imageInsets Property, but whenever I use a SystemItem or an SFSymbol as...
Read more >Using UITabBarAppearance for Tab Bar changes in iOS 13
If you want to adjust other characteristics such as the title position (say to move it further or closer to the icon), font,...
Read more >How to create a custom Tab Bar in SwiftUI - BLCKBIRDS
By the way: we will not use a UITabBarController for this but ... Our tab bar should contain five different icons arranged horizontally....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have found a workaround for now. Use the
loaded
event on theTabView
and iterate over all childs setting the proper vertical alignment.The issue comes from the hardcoded vertical alignment in the
TabView
module sources: https://github.com/NativeScript/NativeScript/blob/014e7a8e0ffaeefd5e0c29f0bfa64459f7547681/tns-core-modules/ui/tab-view/tab-view.ios.ts#L115NS-Vue Implementation (not sure if this is the most direct root, but working):