Skip to content

TabView tab bar font size can't increase or decrease #4869

Closed

Description

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>

Activity

  1. tsonevn commented on Sep 21, 2017

    @tsonevn
    Contributor

    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.

  2. MartoYankov commented on Jan 7, 2019

    @MartoYankov
    Contributor

    There is a way to do this for some time now. See #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>
    
  3. ghost removed on Jan 7, 2019
  4. tofikabdullayev commented on Aug 18, 2019

    @tofikabdullayev

    tabTextFontSize="8" doesn't work

  5. jokkopp commented on Sep 10, 2019

    @jokkopp

    try this in css file

    TabView {
    	tab-text-font-size: 15
    } 
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions