android - GridView as child of FrameLayout with layout_weight -


how make hxw of gridview same hxw of parent view (framelayout) ?

enter image description here

xml :

<framelayout             android:id="@+id/frame_menu"             android:layout_width="fill_parent"             android:layout_height="0dp"             android:layout_weight="8">              <gridview                 android:layout_width="fill_parent"                 android:layout_height="fill_parent"                 android:id="@+id/gridview"                 android:numcolumns="2"                 android:layout_gravity="center" />         </framelayout> 

set gravity android:gravity="fill_horizontal" or android:gravity="fill"; , use android:stretchmode="columnwidth"..

if fails try use auto_fit


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -