gpt4 book ai didi

android - Android Bottom Sheet 无法对触摸使用react并且无法滚动

转载 作者:行者123 更新时间:2023-12-03 10:12:20 25 4
gpt4 key购买 nike

所以我有一个问题:我在创建的LinearLayout View 中添加了一个带有layout_behaviour作为BottomSheetBehaviorFrameLayout并添加到我的Activities的上方,但是我的底部页面无法滚动,我只能以编程方式更改其状态,但是触摸不会使用react。您认为可能是什么问题?

这是我的xml:

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rich_media_container"
android:layout_width="match_parent"
android:layout_height="match_parent">

. . . . . .

<LinearLayout
android:id="@+id/cue_point_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.v7.widget.RecyclerView
android:id="@+id/cue_points_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp" />

. . . . . .

</LinearLayout>

最佳答案

使用CoordinatorLayout作为父布局。

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.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">

<include layout="@layout/bottom_sheet" />
</android.support.design.widget.CoordinatorLayout>

bottom_sheet-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/bottom_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:behavior_hideable="false"
app:behavior_peekHeight="204dp"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

.......

</LinearLayout>

关于android - Android Bottom Sheet 无法对触摸使用react并且无法滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54931400/

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