나는 GridView
을 가지고 있으며 GridView
에 이미지와 텍스트를 적용하기 위해 BaseAdapter
을 사용합니다. 내 응용 프로그램을 실행할 때 'GridView'왼쪽, 오른쪽, 위쪽 및 아래쪽 여백이 한 가지 문제가 있습니다. 나는이 마진을 필요로하지 않는다.Android GridView 전체 화면
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/strada_grid_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#d6d6d6"
android:gravity="center"
android:horizontalSpacing="1dp"
android:numColumns="2"
android:verticalSpacing="1dp" >
</GridView>
GridView
어댑터 xml
코드 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="120dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#ffffff" >
<TextView
android:id="@+id/desc1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/photo1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="-27dp"
android:text="Hello"
android:textColor="#3d3b3b"
android:textSize="12dp" />
<TextView
android:id="@+id/stradaID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/desc1"
android:layout_alignParentBottom="true"
android:text="TextView"
android:textColor="#000000"
android:visibility="gone" />
<ImageView
android:id="@+id/photo1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="38dp" />
</RelativeLayout>
</RelativeLayout>
내 문제를 해결할 수있는 방법
이것은 내 xml
소스입니까?
시도
< 자원은 안드로이드를 제거하는 방법의 gridview에서 verticalSpacing. –
나는 그것을 제거했지만 변경하지 않았습니다 .P.s 거기에 간격이 필요합니다. – BekaKK
@PiYusH GuPtA 아니요. – BekaKK