gpt4 book ai didi

安卓导航组件。显示全屏对话框,导航图标从箭头变为十字

转载 作者:行者123 更新时间:2023-12-05 06:48:00 24 4
gpt4 key购买 nike

我从示例“抽屉导航 Activity ”创建了项目。导航图标适用于顶级和其他目的地。导航图标从“汉堡包”变为“箭头”并返回。

enter image description here

问题

好的。现在我需要实现全屏对话框 recommended用于带有键盘输入的对话框。

enter image description here

我根据 documentation 创建了对话框 fragment 目标:
ProductCountChangeFragment.kt

internal class ProductCountChangeFragment : DialogFragment(R.layout.product_count_change_fragment) {
//...
}

navigation.xml

<dialog
android:id="@+id/product_count_change_dialog_fragment"
android:name="my.package.ProductCountChangeFragment"
tools:layout="@layout/product_count_change_fragment" />

它以常规对话框(非全屏)开始。我相信,导航组件支持 Material 设计建议,但我遗漏了如何启用所需行为的微小细节。

最佳答案

  1. 您可以在 fragment attach() 中隐藏/显示工具栏并在 detach() 中显示
override fun onAttach(context: Context) {
super.onAttach(context)
(activity as? MainActivity)?.run {
goneBottomNavigation()
setStatusBarColor(R.color.C_E6EBEF)
}
}
  1. 这:导航组件也有同样的问题:How to hide toolbar in start destination .

关于安卓导航组件。显示全屏对话框,导航图标从箭头变为十字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66940961/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com