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