Nativescript: TabView tab bar font size can't increase or decrease

Created on 21 Sep 2017  路  4Comments  路  Source: NativeScript/NativeScript

Hi!
I use latest NativeScriptAngular version
I can't increase and decrease tabItem 'Scanner' and 'Term茅keim' font Size
The color change is ok but I can't find how can I css change size?
Can U help me?

TabView {
  selected-tab-text-color: $theme-primary-color;
  border-bottom-color: $theme-primary-color;
  android-selected-tab-highlight-color: $theme-primary-color;
}
<TabView #tabview
                 (selectedIndexChanged)="tabIndexChanged($event)">
            <StackLayout *tabItem="{title: 'Scanner'}">
                ...
            </StackLayout>
            <StackLayout *tabItem="{title: 'Term茅keim'}">
                ...
            </StackLayout>
        </TabView>
tab-view

Most helpful comment

tabTextFontSize="8" doesn't work

All 4 comments

Hi @bumbella,
I reviewed your scenario, however, at the moment there is no functionality, which allows changing the tab's title fontSize. Regarding that, I will mark this as a feature request.

TabView {
  selected-tab-text-color: $theme-primary-color;
  border-bottom-color: $theme-primary-color;
  android-selected-tab-highlight-color: $theme-primary-color;
font-size:30;
}

As a temporary solution, you could set a fontSize for the whole TabView , which will affect the tabs titles and the child component inside the TabView in Android. Keep in mind that this solution will not work for iOS.

There is a way to do this for some time now. See https://github.com/NativeScript/NativeScript/pull/5752.

Basically the TabView has a new property tabTextFontSize and corresponding CSS rule tab-text-font-size which affects only the tab title text.

<Page>
  <TabView tabTextFontSize="8">
    <TabView.items>
      <TabViewItem title="First">
        <TabViewItem.view>
          <GridLayout>
            <Label text="First View" verticalAlignment="center" horizontalAlignment="center"/>
          </GridLayout>
        </TabViewItem.view>
      </TabViewItem>
      <TabViewItem title="Second">
        <TabViewItem.view>
          <GridLayout>
            <Label text="Second View" verticalAlignment="center" horizontalAlignment="center"/>
          </GridLayout>
        </TabViewItem.view>
      </TabViewItem>
    </TabView.items>
  </TabView>
</Page>

tabTextFontSize="8" doesn't work

try this in css file

TabView {
    tab-text-font-size: 15
} 
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Leo-lay picture Leo-lay  路  3Comments

NordlingDev picture NordlingDev  路  3Comments

fmmsilva picture fmmsilva  路  3Comments

NickIliev picture NickIliev  路  3Comments

OscarLopezArnaiz picture OscarLopezArnaiz  路  3Comments