Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.5k views
in Technique[技术] by (71.8m points)

Android使用BottomSheet遇到的一个匪夷所思的问题

项目中用到bottomsheet,xml大致如下:

<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:app="http://schemas.android.com/apk/res-auto"
 android:layout_width="match_parent"
 android:layout_height="match_parent">
 
 ... ...
 
     <FrameLayout
         android:id="@+id/bottom_container"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         app:behavior_hideable="true"
         app:layout_behavior="@string/bottom_sheet_behavior"/>
 
 </androidx.coordinatorlayout.widget.CoordinatorLayout>

FrameLayout中会根据需求动态添加不同的view。现在遇到的问题是,如果FrameLayout中包含RecyclerView(或者其他ScrollView?),behavior_hideable就会有效,否则behavior_hideable无效,无法手动下滑使bottom sheet消失。有大神可以解答一下吗~


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.6k users

...