Created
June 19, 2018 06:36
-
-
Save sharifulislam52/c684342978fff817c76cc3ec86348d5e to your computer and use it in GitHub Desktop.
Android : GridLayout with CardView
This file contains 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
<GridLayout | |
android:columnCount="2" | |
android:rowCount="3" | |
android:alignmentMode="alignMargins" | |
android:columnOrderPreserved="false" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:padding="14dp" | |
> | |
<!-- 1 --> | |
<android.support.v7.widget.CardView | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:layout_columnWeight="1" | |
android:layout_rowWeight="1" | |
android:layout_marginBottom="16dp" | |
android:layout_marginLeft="16dp" | |
android:layout_marginRight="16dp" | |
app:cardElevation="3dp" | |
app:cardCornerRadius="3dp"> | |
<ImageView | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
android:layout_gravity="center" | |
android:src="@drawable/reading_book"/> | |
</android.support.v7.widget.CardView> | |
<!-- 2 --> | |
<android.support.v7.widget.CardView | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:layout_columnWeight="1" | |
android:layout_rowWeight="1" | |
android:layout_marginBottom="16dp" | |
android:layout_marginLeft="16dp" | |
android:layout_marginRight="16dp" | |
app:cardElevation="8dp" | |
app:cardCornerRadius="8dp"> | |
<ImageView | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
android:layout_gravity="center" | |
android:src="@drawable/reading_book"/> | |
</android.support.v7.widget.CardView> | |
<!-- 3 --> | |
<android.support.v7.widget.CardView | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:layout_columnWeight="1" | |
android:layout_rowWeight="1" | |
android:layout_marginBottom="16dp" | |
android:layout_marginLeft="16dp" | |
android:layout_marginRight="16dp" | |
app:cardElevation="8dp" | |
app:cardCornerRadius="8dp"> | |
<ImageView | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
android:layout_gravity="center" | |
android:src="@drawable/reading_book"/> | |
</android.support.v7.widget.CardView> | |
<!-- 4 --> | |
<android.support.v7.widget.CardView | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:layout_columnWeight="1" | |
android:layout_rowWeight="1" | |
android:layout_marginBottom="16dp" | |
android:layout_marginLeft="16dp" | |
android:layout_marginRight="16dp" | |
app:cardElevation="8dp" | |
app:cardCornerRadius="8dp"> | |
<ImageView | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
android:layout_gravity="center" | |
android:src="@drawable/reading_book"/> | |
</android.support.v7.widget.CardView> | |
<!-- 5 --> | |
<android.support.v7.widget.CardView | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:layout_columnWeight="1" | |
android:layout_rowWeight="1" | |
android:layout_marginBottom="16dp" | |
android:layout_marginLeft="16dp" | |
android:layout_marginRight="16dp" | |
app:cardElevation="8dp" | |
app:cardCornerRadius="8dp"> | |
<ImageView | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
android:layout_gravity="center" | |
android:src="@drawable/reading_book"/> | |
</android.support.v7.widget.CardView> | |
<!-- 6 --> | |
<android.support.v7.widget.CardView | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:layout_columnWeight="1" | |
android:layout_rowWeight="1" | |
android:layout_marginBottom="16dp" | |
android:layout_marginLeft="16dp" | |
android:layout_marginRight="16dp" | |
app:cardElevation="8dp" | |
app:cardCornerRadius="8dp"> | |
<ImageView | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
android:layout_gravity="center" | |
android:src="@drawable/reading_book"/> | |
</android.support.v7.widget.CardView> | |
</GridLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment