I am creating a tabbed application for which i was testing out a google’s tutorial on tab layout .
I am able to successfully run the hellotabwidget in the emulator , but when i am viewing the main.xml file in graphical layout editor of eclipse , it doesn’t show the tabs , and it’s content . It just shows some sort of
And thus I am not able to use the graphical editor to add buttons , or other things into the created tabs because i can’t view them in the graphical editor.
Can anyone help regarding this .
As per you Comments on this questions you’re misunderstood about the
TabHostHere, i provide you some explanations.TabHost
Container for a tabbed window view. This object holds two children: a set of tab labels that the user clicks to select a specific tab, and a FrameLayout object that displays the contents of that page. The individual elements are typically controlled using this container object, rather than setting values on the child elements themselves.
Tab Widget
Displays a list of tab labels representing each page in the parent’s tab collection. The container object for this widget is TabHost. When the user selects a tab, this object sends a message to the parent container, TabHost, to tell it to switch the displayed page. You typically won’t use many methods directly on this object. The container TabHost is used to add labels, add the callback handler, and manage callbacks. You might call this object to iterate the list of tabs, or to tweak the layout of the tab list, but most methods should be called on the containing TabHost object.
And, the important thing is below image is
TabWidgetand, you can’t drag & drop any button there for making tabs directly.The Exclamatory symbol is not an error. That’s the symbol of tabwidget. Have a look at below code –
From, the comments lines you can understand how can we create the tabs. By extending of TabActivity for your activity only you can use Above code.
Have a look at this Basic Example
Hope these explanations will helps you.