6 years ago (2015-04-01)  Software development |   First to comment  10 
post score 0 times, average 0.0

How to use Tabhost tab components

Tabhost tab components are personally considered to be common in Android APPs, such as QQ, App Store, and so on.The following is the QQ tab: QQ believes that it is a must-have for people in the country. It uses messages, contacts, and dynamic three tabs. It also writes a different interface for each tab. This is similar to the “contact” I wrote. Here's how I implemented the tabs and created different interactive interfaces for each option. Tabhost tab uses layout code:

 

How to move TabWidget below

1. First use RelativeLayout to wrap tabwidget and FrameLayout while adding properties to the tabwidget:

2. The problem with the above step is that the tabwidget of the tab will float at the bottom, but the contents of the tabcontent will also fill the entire screen instead of the tabwidget.To solve this problem, you need to add the following properties to FrameLayout:

How to add content for tabHost (Activity)

The code to achieve is as follows:

""

new Intent(this,about.class) indicates that the content in tab3 is about.Java.

 

This article has been printed on copyright and is protected by copyright laws. It must not be reproduced without permission.If you need to reprint, please contact the author or visit the copyright to obtain the authorization. If you feel that this article is useful to you, you can click the "Sponsoring Author" below to call the author!

Reprinted Note Source: Baiyuan's Blog>>https://wangbaiyuan.cn/en/tabhost-tab-component-usage-2.html

Post comment

Style

No Comment

登录

Forget password?

您也可以使用第三方帐号快捷登录

切换登录

注册

TW