How can I set the height of tabs in Android a TabLayout?

前端 未结 3 1055
孤独总比滥情好
孤独总比滥情好 2021-01-12 06:37

I Have this TabLayout in Android and wanted to make the tabs a little heigher than the default (48dp)

    

        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 06:54

    set a layout_height in dps instead of wrap_content this could differ in different display sizes but if you wanna set a height dynamically

    getApplication.getResources().getDisplayMetrics()
    

    get your current height and calculate the height according to that

提交回复
热议问题