Custom TextSize of BottomNavigationView support android

前端 未结 8 1315
别跟我提以往
别跟我提以往 2020-12-12 23:53

I am trying to change the textSize of BottomNavigationView from android support library 25.0.0



        
8条回答
  •  鱼传尺愫
    2020-12-13 00:22

    Add the TabTextStyle code inside the UpdateBarTextColor (this void exist in BottomBarPageRenderer)

     void UpdateBarTextColor()
        {
            if (_disposed || _bottomBar == null)
            {
                return;
            }
            //This is linked to styles.xml to set size of text
            _bottomBar.SetTextAppearance(Resource.Style.TabTextStyle);
            //Set color of text and icon in BottomNavBar
            _bottomBar.SetActiveTabColor(Element.BarTextColor.ToAndroid(Color.FromHex("#0094F0")));
            // The problem SetActiveTabColor does only work in fiexed mode // haven't found yet how to set text color for tab items on_bottomBar, doesn't seem to have a direct way
        }
    

    And then add this inside the styles.xml:

     
    

提交回复
热议问题