android中的Psuedo标签
我想让用户知道他在使用标签的应用程序的哪个页面上。因此,如果他在第一页,第一页的标签将被点亮,如果他在第二页,第二页的标签将被点亮,等等。但是我想要它,这样标签就没有任何功能了。它们在所有页面上保持不变(执行点亮的内容),并且没有触摸/点击事件。我应该使用标签吗?还是有更好的选择?我如何通过选项卡实现更好的选择?提前感谢最好的方法可能是避免完全使用选项卡小部件,只需使用像LinearLayout这样的容器中排列的文本视图即可android中的Psuedo标签,android,android-layout,tabs,Android,Android Layout,Tabs,我想让用户知道他在使用标签的应用程序的哪个页面上。因此,如果他在第一页,第一页的标签将被点亮,如果他在第二页,第二页的标签将被点亮,等等。但是我想要它,这样标签就没有任何功能了。它们在所有页面上保持不变(执行点亮的内容),并且没有触摸/点击事件。我应该使用标签吗?还是有更好的选择?我如何通过选项卡实现更好的选择?提前感谢最好的方法可能是避免完全使用选项卡小部件,只需使用像LinearLayout这样的容器中排列的文本视图即可 <?xml version="1.0" encoding="ut
<?xml version="1.0" encoding="utf-8"?>
<!-- Top-level layout for page -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- Tab Bar -->
<LinearLayout
android:id="@+id/tab_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- Tab 1 -->
<TextView
android:id="@+id/tab_bar_file"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/file_label"/>
<!-- Tab 2 -->
<TextView
android:id="@+id/tab_bar_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/edit_label"/>
<!-- More tabs go here -->
</LinearLayout>
<!-- Page content goes here -->
</LinearLayout>
关于这一点,请注意:
最好的方法可能是避免完全使用tab小部件,只需使用像LinearLayout这样的容器中排列的文本视图即可
<?xml version="1.0" encoding="utf-8"?>
<!-- Top-level layout for page -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- Tab Bar -->
<LinearLayout
android:id="@+id/tab_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- Tab 1 -->
<TextView
android:id="@+id/tab_bar_file"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/file_label"/>
<!-- Tab 2 -->
<TextView
android:id="@+id/tab_bar_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/edit_label"/>
<!-- More tabs go here -->
</LinearLayout>
<!-- Page content goes here -->
</LinearLayout>
关于这一点,请注意: