Ich arbeite an Raster-Layout mit Recyclerview in Android. Das Gitter nimmt einen Teil des Bildschirms ein und hat einen Schatten. Um den gewünschten Schatteneffekt zu erhalten, verwende ich einen Höhenwert von 12 dp. Aber es scheint nicht zu funktionieren, da ich keine Höhe (Schatten) des Gitters sehen kann. Warum passiert dies? Unterstützt Recyclerview keine Höhe?Wie setze ich den Höhenwert richtig auf Recyclerview?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/activity_grid_layout"
android:background="@drawable/gradient"
android:layout_height="match_parent"
tools:context="com.mindhive.mindhive.activities.GridActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/grid_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="110dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="80dp"
android:background="@color/transparent"
android:elevation="12dp"
android:scrollIndicators="none"
android:scrollbars="none"
android:padding="0dp" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/grid_recycler_view"
android:layout_alignStart="@+id/grid_recycler_view"
android:layout_marginBottom="-18dp"
android:layout_marginStart="67dp"
android:src="@drawable/main_filter"
android:elevation="1dp" />
......
Vielleicht möchten Sie Karten verwenden, die an der Höhe angehoben werden können. –
Ich möchte keine Höhe für die Elemente in der Recyclerview, sondern ich suche nach Höhe für die gesamte Recyclerview. – Neanderthal