0

I have a GridView within FrameLayout as shown below:

Gridview Screen

As seen, numbers are aligned closer to left side of the screen. I have tried to bring numbers closer so that i could solve the problem, but failed. Playing around with stretchMode like 'columnWidth' and 'none' couldn't solve my problem. Please suggest me any way that i can fit numbers within background white area.

.xml file:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >


<FrameLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <GridView
        android:id="@+id/gridview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/paperbck"
        android:columnWidth="30dp"
        android:gravity="center"
        android:horizontalSpacing="20dp"
        android:numColumns="4"
        android:stretchMode="columnWidth"
        android:verticalSpacing="20dp" />


</FrameLayout>

</LinearLayout>
Umit Kaya
  • 5,771
  • 3
  • 38
  • 52

1 Answers1

0

Try giving left margin to the Grid View.

Thasneem
  • 245
  • 1
  • 9
  • This didnt work. But just now when i search found: android:paddingLeft="20dp" solved my issue but im not sure it is a smart way. Thx though – Umit Kaya Jun 05 '14 at 12:18
  • Yes...padding is a better way..go ahead and use it without a doubt. I was about to comment to you to use paddingleft in any way... :) – Ramakishna Balla Jun 05 '14 at 12:39