【问题标题】:Make view clickable underneath recyclerview在recyclerview下使视图可点击
【发布时间】:2016-01-06 01:52:24
【问题描述】:

我正在尝试实现类似于 Google Play 商店应用的外观





现在我得到了这个

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/image"
        android:layout_width="match_parent"
        android:layout_height="200dp" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:paddingTop="200dp" />

</FrameLayout>

看起来不错,但由于 Recyclerview 与 ImageView 重叠,因此不再可点击。我正在寻找解决方案。

【问题讨论】:

  • @AmeyaKulkarni 已经尝试过了。不工作。

标签: android android-layout android-recyclerview


【解决方案1】:

您可以在 android studio 中使用滚动活动模板,它的行为与您想要做的类似。 并将ImageView 放入AppBarLayout 并像处理任何其他视图一样处理点击事件。

这不会为您提供 google play 应用程序的确切行为,但如果它是简单的方法。 如果您想要确切的行为,我知道一个开源库,如果您想要它,请告诉我,我会搜索它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-04
    • 2015-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多