我的标题栏是用的一个xml
setContentView(R.layout.Main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.top);
top.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000">
<ImageButton
android:id="@+id/imageButtonLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:src="@drawable/prv" /> <TextView android:id="@+id/toptitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="标题栏" /> <ImageButton
android:id="@+id/imageButtonRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:layout_centerInParent="true"
android:layout_alignParentRight="true"
android:src="@drawable/shuaxin" />
</RelativeLayout> 我要实现每切换一个Activity 上面的标题栏TextView的值就改变 这个应该怎么实现?
setContentView(R.layout.Main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.top);
top.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000">
<ImageButton
android:id="@+id/imageButtonLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:src="@drawable/prv" /> <TextView android:id="@+id/toptitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="标题栏" /> <ImageButton
android:id="@+id/imageButtonRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:layout_centerInParent="true"
android:layout_alignParentRight="true"
android:src="@drawable/shuaxin" />
</RelativeLayout> 我要实现每切换一个Activity 上面的标题栏TextView的值就改变 这个应该怎么实现?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货