1
我必须将TabBar添加到我的应用程序中的每个活动。我该怎么做呢?android:将标签栏添加到应用程序中的所有活动
我必须将TabBar添加到我的应用程序中的每个活动。我该怎么做呢?android:将标签栏添加到应用程序中的所有活动
您可以使用include tag或viewstub甚至fragments
下面介绍如何使用include
达到你想要
include
标记指向您的toolbar.xml例子:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:layout_width="fill_parent">
<include android:id="@+id/titleBar" layout="@layout/title_bar"
android:layout_width="fill_parent" android:layout_height="48dip" />
<!-- All the rest of your activity layout below -->
</RelativeLayout>
ü可以给演示的例子? – user725753 2011-04-26 17:36:19
当然,我延长了我的答案 – Bostone 2011-05-18 18:09:39