Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用AppCompat 并使用ActionBar.Tab来设置选项卡,现在我需要获取Tab Height吗?
ActionBar.Tab
Tab
任何帮助将不胜感激。
尝试:
TabHost myTabHost= getTabHost(); int tabHeight = myTabHost.getTabWidget().getHeight();
你可以使用
getToolbar().getHeight();
或者如果您使用的是 AppCompatActivity
getSupportActionBar().getHeight();
假设您已经设置了工具栏。
干杯