Custom Tab Disappears on Click?
In my Android application I have three tabs 开发者_JAVA百科in TabHost
.
Tab number 2 and 3 loads some data that will take around 4-5 seconds to load. When I click on any of these tabs, the tab disappeared until the data got loaded. Is there any reason for that? How can I handle this disappearing tab ?
One more thing that I should have to mention here is that I am creating Custom Tabs. But no rocket science in custom tabs just follow this links tutorial: http://joshclemm.com/blog/?p=136.
Well I have fixed the problem and find it out what I have done wrong.
The tab_bg_selector.xml file in the example is using android:state_pressed="true" and android:state_focused="true" item states which I have copy/paste in my code as it is. When the Tab is pressed the android:drawable="@android:color/transparent" will make the image transparent until the selected Image will display
So both these item are removed from the .xml file and now it working good :)
精彩评论