Android switch card tabwidget usage example

This article describes the usage of Android switch card tabwidget with examples. Share with you for your reference, as follows:

The tab tab is similar to the interface of the phone book. You can switch different contents through multiple tabs. To achieve this effect, you must first know the tabhost, which is a container for storing multiple tab tabs. Each tab can correspond to its own layout. For example, the tab layout in the phone book is a linear layout

To use tabhost, first obtain the object of tabhost through gettabhost method, and then add tabs to tabhost through addtab method. Of course, each tab will generate an event during switching. To capture this event, you need to set the event listener setontabchangedlistener of tabactivity

Here is a small example:

TabTest. java:

main. xml:

More readers interested in Android related content can view the special topics of this site: summary of Android control usage, summary of Android view skills, summary of Android SQLite database skills, summary of Android JSON format data skills, summary of Android database operating skills, summary of Android file operating skills Summary of SD card operation methods for Android programming development, introduction and advanced tutorial for Android development, and summary of Android resource operation skills

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>