1

enter image description here

I searched a lot but could not find specific solution for my problem. I am posting a screen shot where you can see a tab widget. Also there is an exclamation mark there don't know why! You can see on the right bottom corner there is Background set to drawable. I have put the same named drawable into x,m,l,s, dpi folders. Also you can see in the Screen shot that there is API 8 used. Now the problem that I am facing is I can see the background set for 4.0 but not for 2.2! I have used setBackgroundResource also in class file, I tried to set alpha 0 for this tabwidget also. But don't know why its not taking my image as its Bg for API 8!! Thanks all would appreciate any relevant help.

4

1 回答 1

0

我确实像你一样尝试过,结果相同..在 api 8 上使用正常的 tabhost。

但最后我下载了: http ://code.google.com/p/android-custom-tabs/downloads/detail?name=customized-tabs.zip&can=2&q=

作为示例编辑 tab_bg_unselected.xml 将其更改为透明而不是渐变。

用 android:color @android:color/transparent 放置一个实体元素,之后它会是透明的。

然后为 tabhost 设置一个背景图像,它工作得很好。

作者文章是:http: //joshclemm.com/blog/ ?p=136

我认为这是一个非常好的解决方案,您甚至可以使用该解决方案进行更大的定制。

它是一个不错的workarround,希望你会喜欢它:)

这是真正的 2.2.1 摩托罗拉里程碑的屏幕截图 安卓2.2.1

注意:甚至在最新的 Nexus 7 4.3 平板电脑和 S2 4.1.2 上进行了验证

于 2013-09-08T22:13:58.017 回答