BottomSheetDialog即使在Android 10上也处于隐藏状态,在底部仍可见

问题描述 投票:0回答:1

screen1

解释图像:-

  1. 登录按钮=显示登录视图
  2. 注册按钮=显示注册视图
  3. 忘记密码底页

(编辑图像以隐藏徽标)

问题= BottomSheetFragment在底部可见经过测试的设备= Samsung,RealMe =两者均使用android 10

欢迎页面的XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".welcome.Welcome">

    <include layout="@layout/activity_welcome_content" />

    <include layout="@layout/fragment_sign_in" />

    <include layout="@layout/fragment_sign_up" />

    <include layout="@layout/fragment_forgot_password" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>

xml代码在所有片段中使用

app:behavior_hideable="true"
app:behavior_peekHeight="0dp"
app:layout_behavior="@string/bottom_sheet_behavior"

还实现了此theme以具有工作表的自定义设计,并且具有默认工作表的不可见背景

<style name="AppBottomSheetTheme" parent="Theme.Design.Light.BottomSheetDialog">
    <item name="bottomSheetStyle">@style/AppModalStyle</item>
</style>

<style name="AppModalStyle" parent="Widget.Design.BottomSheet.Modal">
    <item name="android:background">@color/trans</item>
    <item name="behavior_hideable">true</item>
    <item name="behavior_peekHeight">500dp</item>
</style>

也在welcome类中也尝试过此方法>

//using kotlin
forgotSheetBehavior.isHideable = true
forgotSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN

仍然在底部看到BottomSheetDialogFragment,这在使用Android 10的像素模拟器中不可见

解释图像:-登录按钮=显示登录视图注册按钮=显示注册视图忘记密码底页(编辑图像以隐藏徽标)问题=可见BottomSheetFragment ...

android android-layout bottom-sheet
1个回答
0
投票
由于某些原因
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.