【发布时间】:2019-05-30 07:22:26
【问题描述】:
我的导航有问题:我使用MvxTabsFragmentActivity 创建了一个选项卡式应用程序,并且一切正常,直到我开始在选项卡内导航;如果我在一个选项卡内导航一个级别,然后更改选项卡,则在第二个选项卡上,我会看到第一个选项卡中的内容。有人遇到过这个问题吗?
我使用TabHost 创建了标签。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/actualtabcontent"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_above="@+id/tabContainer"/>
<LinearLayout android:id="@+id/tabContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<TabHost android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="7dp"
android:background="@drawable/gradient_border_top"
android:orientation="horizontal" />
<TabWidget android:id="@android:id/tabs"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_weight="0"
android:background="@color/white" />
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
</LinearLayout>
</TabHost>
</LinearLayout>
</RelativeLayout>
每次我在标签内导航时,都会替换实际标签内容的内容。
预期导航:
选项卡 A:A1 -> A2。
选项卡 B:B1 -> B2。
在选项卡之间切换应显示所选选项卡的内容
【问题讨论】:
标签: android xamarin tabs mvvmcross