Q
刪除標籤欄的底線
1
A
回答
1
我使用自定義視圖從標籤欄中刪除行。爲標籤視圖
自定義佈局:
<ImageView
android:id="@+id/tab_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:contentDescription="@string/tab_desc"
android:gravity="center" />
</LinearLayout>
設置選項卡視圖:
private void setUpTabs() {
TabSpec spec0 = tabHost.newTabSpec("Tab");
spec0.setContent(R.id.tab_list);
spec0.setIndicator(tabView(R.drawable.image));
tabHost.addTab(spec0);
}
// Return view for tab
private View tabView(int drawableId) {
View view = LayoutInflater.from(this).inflate(R.layout.tab_image,
tabHost.getTabWidget(), false);
ImageView imageView = (ImageView) view.findViewById(R.id.tab_icon);
imageView.setImageResource(drawableId);
return view;
}
0
我刪除它使用
// Create Child Tab1
mTabHost.addTab(mTabHost.newTabSpec("child1").setIndicator("your text",getResources().getDrawable(R.drawable.your_image)),
yourclass.class, null);
mTabHost.getTabWidget().getChildAt(0).setBackgroundColor(getResources().getColor(R.color.your background color));
mTabHost.getTabWidget().getChildAt(0).setBackgroundResource(R.drawable.your_image);
我設置背景顏色,然後用藍線自動消失了上面的代碼中設置選項卡上的圖像,希望這對您有所幫助。
0
使用這種代碼,並從tabhost除去線底部
android:tabStripEnabled="true"
tabHost.getTabWidget.setStripEnabled(true);
相關問題
- 1. 刪除標籤欄
- 2. 如何刪除操作欄的底線
- 3. 刪除導航欄/搜索欄底部的黑線
- 4. 刪除標籤欄中的徽章
- 5. 刪除推視圖上的標籤欄
- 6. 刪除標籤欄模糊效果
- 7. 刪除UI導航欄/標籤欄和視圖之間的細線?
- 8. ggrepel刪除標籤周圍的線條
- 9. IOS底部標籤欄標題
- 10. 頂部和底部的標籤欄
- 11. 帶有MonoTouch.Dialog底部的標籤欄?
- 12. Android中的底部標籤欄
- 13. 如何禁用/刪除android活動標籤和標籤欄?
- 14. 如何刪除在我的標籤頁中創建的額外底部標籤欄
- 15. 刪除欄標CSS
- 16. 刪除PhpStorm藍色標籤下劃線
- 17. 刪除線和標籤vb.net更新
- 18. 如何設置在標籤欄底線邊界
- 19. 標籤欄(底部)是什麼字體?
- 20. 的Android刪除標題欄
- 21. 刪除操作欄中的標籤和應用程序圖標
- 22. 如何刪除標籤刪除線一次在傳奇
- 23. 刪除Android ListView的底部分隔線
- 24. 如何刪除表底下的線
- 25. 從inno設置的底部面板刪除語言標籤
- 26. 如何刪除Android中底部標籤的行?
- 27. 刪除html標籤
- 28. 刪除標籤foreach
- 29. 刪除H1標籤
- 30. 刪除HTML標籤
我已經有了tabWidget的背景圖片。設置背景顏色將重疊圖像。 – Geek
你有沒有試過設置?當你設置背景顏色時,它隱藏了那條藍線。 –
是的,我做過。但是這也隱藏了圖像。 – Geek