K Y Iyer K Y Iyer - 13 days ago 6
Android Question

Android Gridview Making Images Larger

Am trying to use Android GridView to show 2 columns of images.

<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="2"
android:verticalSpacing="5dp"
android:horizontalSpacing="5dp"
android:stretchMode="columnWidth"
android:gravity="center"/>


Am running the app on a Samsung J2 physical device. The screenshot looks like this

App Screenshot

Help!


  1. I can't get the images to be any bigger - they are all 200x150 - the screenshot does not look anywhere near displaying 200x150. I have tried every option - but the correct one.

  2. I want to display a text under each image - GridView does not seem to have an option. Will I have to use the TableView?



Many thanks

Iyer

Answer

Try this like out! I think this very nice starting example for you to do what you want.

Hope this will help you.

Comments