mus*_*off 5 android android-fragments android-dialogfragment android-navigation android-architecture-navigation
我试图在导航组件中从导航DialogFragment到Fragment,但是结果很奇怪。
当我从导航DialogFragment到时Fragment,背景片段会更改为目标片段,并在其顶部显示当前对话框,而不仅仅是移动到目标片段。
这是导航图。
<navigation
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"
android:id="@+id/home"
app:startDestination="@+id/titleScreen">
<fragment
android:id="@+id/titleScreen"
android:name="com.example.android.navigationadvancedsample.homescreen.Title"
android:label="@string/title_home"
tools:layout="@layout/fragment_title">
<action
android:id="@+id/action_title_to_about"
app:destination="@id/aboutScreen"/>
</fragment>
<dialog
android:id="@+id/aboutScreen"
android:name="com.example.android.navigationadvancedsample.homescreen.About"
android:label="@string/title_about"
tools:layout="@layout/fragment_about">
<action
android:id="@+id/action_aboutScreen_to_register"
app:destination="@id/register" />
</dialog>
<fragment
android:id="@+id/register"
android:name="com.example.android.navigationadvancedsample.formscreen.Register"
android:label="fragment_leaderboard"
tools:layout="@layout/fragment_leaderboard" />
</navigation>
Run Code Online (Sandbox Code Playgroud)
为什么我会出现这种现象或如何解决?
修复是指正常的对话框行为。我说,我有一个对话框d上的一个分段的顶部一个,并移动到一个片段乙从一个按钮d,屏幕应该显示乙。当我从B弹出时,它应该转到A之上的D的前一阶段。
感谢@musooff 提交此错误
此问题已在 Navigation 2.1.0-alpha06 以及弹出对话框时的后退按钮等其他对话框不一致问题上得到修复。
但是,如果可以,请更新到 2.1.0-beta02 或更高版本。