question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] - Error when setting a font on TabView on iOS

See original GitHub issue

Issue: After upgrading to {N} 2.5 and then setting a custom font (family or size) using CSS on a TabView I get the following error in the console using the iOS simulator:

CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:344:22: Error: Uncaught (in promise): TypeError: null is not an object (evaluating 'tabBar.items.count')

It seems to be working when setting the font-family directly on the TabView (just shows the error in the console). However when I set the custom font on the Page instead of directly on the TabView the whole TabView is blank.

This only applies to iOS. Works fine on the Android emulator.

Example: Tried this with {N} 2.5 on the default ng template using tns create component-core --ng and then modifying the default items.component.html with the following template.

items.component.html

<ActionBar title="TestTitle" style.backgroundColor="#149718"></ActionBar>

<TabView sdkExampleTitle sdkToggleNavButton>
    <StackLayout *tabItem="{title: 'Overview'}" >
        <Label text="Test Label"></Label>
    </StackLayout>
</TabView>

app.css

TabView {
    background-color: #F3F3F3;
    font-family: 'Courier'; // Enabling this (without the font-family defined on the Page) results in just the console error
}


Page { 
    font-family: 'Courier'; // Enabling this results in the error and shows a blank TabView 
}

Versions: Nativescript version: 2.5 Nativescript-angular version: 1.4.0 (also tried the next version: 1.4.1-2017-01-31-1230)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vchimevcommented, Feb 16, 2017

@bsnelder, @codeback, @pap5508,

We just published tns-core-modules@2.5.1 which addresses the issue.

I moved the issue to the respective repo.

1reaction
vchimevcommented, Feb 16, 2017

This issue was moved to NativeScript/NativeScript#3646

Read more comments on GitHub >

github_iconTop Results From Across the Web

UI Tab Bar Bug | Apple Developer Forums
Hi. I'm trying to setup tab bar item text appearances, but the global UITabBarItem isn't accepting them. I mad a very simple assignment...
Read more >
SwiftUI Not Applying Custom Font to Tabbed View
It's utilizing the custom font in the first Text (main labels) but not in the tabs. How do I fix this? Thanks ![enter...
Read more >
How to change Tab Bar Item font when selected in Swift
This is a iOS tutorial on how to change Tab Bar Item font when selected in Swift using UIKit. Learn this user interface...
Read more >
Material Top Tabs Navigator | React Navigation
A material-design themed tab bar on the top of the screen that lets you switch between different routes by tapping the tabs or...
Read more >
SOLVED: Problems with TabView – SwiftUI - Hacking with Swift
This may cause bugs by forcing views inside the table view to load and ... PersonList() var body: some View { TabView {...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found