문제

i have an issue while trying to show a gridview on my FrameLayout.

I'm using FrameLayout because my navigation drawer is on the same activity.

The problem is the following:

EDIT: I had to let only the link because stackoverflow does not allow me to post images.

http://i.stack.imgur.com/yZNVI.png

And here is my code:

<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">


<FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff">
     <LinearLayout android:id="@+id/header"
        android:background="@layout/header_gradient"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <ImageView android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:layout_marginLeft="10.0dip"
            android:src="@drawable/logo"
            android:contentDescription="@string/img_foot_desc"/>
    </LinearLayout>
     <LinearLayout android:orientation="vertical"
        android:padding="10.0dip"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <GridView
    android:id="@+id/gridView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="4dp"
    android:columnWidth="100dp"
    android:gravity="center"
    android:numColumns="auto_fit"
    android:stretchMode="columnWidth"
    android:layout_gravity="center_horizontal|center_vertical">
</GridView>
    </LinearLayout>
    <LinearLayout android:orientation="horizontal"
        android:id="@+id/footer"
        android:background="@layout/footer_repeat"
        android:layout_width="fill_parent"
        android:layout_height="90.0dip"
         />
    </FrameLayout>

<ListView
    android:id="@+id/left_drawer"
    android:layout_width="240dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:choiceMode="singleChoice"
    android:divider="@android:color/transparent"
    android:dividerHeight="0dp"
    android:background="#069"/>

Any way to show it correctly?

Thanks in advance!

도움이 되었습니까?

해결책

Try adjusting android:layout_margin="4dp" or remove it form <GridView>..</GridView>.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top