[英]Android: get height of tab bar?
有什么辦法可以讓我在Android中獲得標簽欄的高度? 它的getHeight()方法似乎只返回0。
謝謝!
在您的代碼中嘗試一下。
for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {
RelativeLayout relativeLayout =(RelativeLayout)tabHost.getTabWidget().getChildAt(i);
relativeLayout.getChildCount();
TextView tabhostText = (TextView) relativeLayout.getChildAt(1);
tabhostText.setTextSize(20.0f); // you can set the TextSize of your tab also
tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = 30;
}
它將起作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.