android - TabWidget will not display, even though it displays in ADT editor -
my tabwidget not display, though shows in eclipse graphical editor. can't find reason why. why isn't tab bar showing?
eclipse
emulator
xml source of activity: http://pastebin.com/au9xfxpa
extract activity:
<tabwidget android:id="@android:id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" > </tabwidget>
results android lint:
$ lint.bat res/layout/activity_calculator.xml scanning catalyst: . no issues found.
it's hard tell without actual code of how activity implemented, seems need call setcontent()
on tabhost
:
tabhost tabs = (tabhost)findviewbyid(r.id.tabhost); tabs.setup(); // calculator tabhost.tabspec calculatortab = tabs.newtabspec("calculator"); calculatortab.setcontent(r.id.calculator); calculatortab.setindicator("calculator"); tabs.addtab(calculatortab); // home tabhost.tabspec hometab = tabs.newtabspec("home"); hometab.setcontent(r.id.home); tabs.addtab(hometab); // home tabhost.tabspec faqtab = tabs.newtabspec("faq"); faqtab.setcontent(r.id.faq); tabs.addtab(faqtab);
this should give idea.
Comments
Post a Comment