Created
June 12, 2017 01:52
-
-
Save granoeste/6871f47823349cb2122b1a996213793b to your computer and use it in GitHub Desktop.
How to set elevation to RecyclerView?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:layout_gravity="center" | |
android:clipToPadding="false" | |
android:gravity="center" | |
android:padding="32dp"> | |
<TextView | |
android:id="@+id/title" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_alignParentTop="true" | |
android:layout_centerHorizontal="true" | |
android:text="TITLE............!" | |
android:textAppearance="@style/TextAppearance.AppCompat.Headline" /> | |
<android.support.v7.widget.RecyclerView | |
android:id="@+id/list" | |
android:name="com.example.elevation.ItemFragment" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:layout_above="@+id/button" | |
android:layout_below="@+id/title" | |
android:background="@android:color/holo_blue_light" | |
android:elevation="2dp" | |
app:layoutManager="LinearLayoutManager" | |
tools:context="com.example.elevation.ItemFragment" | |
tools:listitem="@layout/fragment_item" /> | |
<Button | |
android:id="@+id/button" | |
style="@style/Base.Widget.AppCompat.Button.Colored" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_alignParentBottom="true" | |
android:layout_centerHorizontal="true" | |
android:text="Button" /> | |
</RelativeLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
android - How to properly set elevation value to recyclerview? - Stack Overflow
material design - Android "elevation" not showing a shadow - Stack Overflow
Elevation & shadows - Material design - Material design guidelines