我已经实现了CollapsingToolbarLayout
,如下所示:
滚动时会崩溃,但是存在一个大问题:我无法点击其中的项目(后退按钮,编辑按钮,编辑文本字段等)。没有任何项目对点击/触摸事件做出反应。
现在,"逻辑"以XML结构,具有以下结构:
<CoordinatorLayout>
<AppBarLayout>
<CollapsingToolbarLayout>
<RelativeLayout/> here's where the panel layout sits
<Toolbar/>
<NestedScrollView/>
//close tags as appropriate here
如何使项目可点击(嗯,不是通过设置android:clickable="true"
来确定)?是否可以在Java/Kotlin
代码中编写听众?
答案 0 :(得分:-1)
尝试添加此XML属性
android:descendantFocusability="blocksDescendants"
到您的CollapsingToolbarLayout