문제

다음과 같이 FrameLayout 내에서 GridView가 있습니다.

gridview 화면

보듯이 숫자는 화면의 왼쪽에 더 가깝게 정렬됩니다.나는 문제를 해결할 수 있도록 숫자를 더 가깝게 가져 오려고했지만 실패했습니다.'columnwidth'와 같은 스트레치 모드를 사용하면 '없음'이 문제를 해결할 수 없었습니다.백그라운드 백색 영역 내에서 숫자에 맞을 수있는 방법을 제안하십시오.

.xml 파일 :

<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>
.

도움이 되었습니까?

해결책

격자보기에 왼쪽 여백을 제공 해보십시오.

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