android - How to automatically align the height of the GridView item? -
my activity has 3 elements. linearlayout, gridview , linearlayout. see picture. how make gridview items visible if there scroll on screens? p.s. sorry english.
use code such layout design... <?xml version="1.0" encoding="utf-8"?> <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:orientation="vertical" android:layout_height="match_parent"> <linearlayout android:id="@+id/layouttoplay" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/btn_br_color" android:gravity="center" android:layout_alignparenttop="true" android:padding="3dp"> <textview android:id="@+id/primiumgamenametext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:maxlines="4" android:text="layout1" android:textsize="18sp" android:textstyle="bold" /> </linearlayout> <gridview android:id="@+id/gridviewid" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="10dp" android:layout_below="@+id/layouttoplay" android:layout_above="@+id/layoutbottomlay" android:paddingright="5dp" android:paddingtop="3dp" /> <linearlayout android:id="@+id/layoutbottomlay" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/btn_br_color" android:gravity="center" android:layout_alignparentbottom="true" android:padding="3dp"> <textview android:id="@+id/layoutbottomtext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="fill" android:gravity="center" android:maxlines="24" android:text="layout2" android:textsize="18sp" android:textstyle="bold" /> </linearlayout>
Comments
Post a Comment