2012-09-28 4 views
-1

내 안드로이드에, 나는 목록이 있고 각 목록 항목은 세 개의 GridView를 표시합니다. 하나의 GridView는 모든 항목을 세부 정보와 함께 표시하고 두 번째 항목은 해당 목록과 관련된 일부 작업을 표시 한 다음 세 번째 항목은 로그 아웃 작업을 표시합니다.안드로이드 : 그리드보기에 사용자 정의보기를 추가하십시오

구현할 수 있습니까? 그렇다면 구현하는 가장 좋은 방법을 알려주십시오.

답변

0

ListView에 모눈을 추가하려면 모눈보기 대신 GridLayout을 사용할 수 있습니다. xml 코드를 따라 목록보기 항목을 사용자 정의하십시오.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/whole_row" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="horizontal" > 
    <GridLayout 
     android:id="@+id/one" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:columnCount="3" 
     android:orientation="horizontal" 
> </GridLayout> 
<GridLayout 
     android:id="@+id/two" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:columnCount="3" 
     android:orientation="horizontal" 
> </GridLayout> 
<GridLayout 
     android:id="@+id/three" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:columnCount="3" 
     android:orientation="horizontal" 
> </GridLayout> 
</LinearLayout> 
관련 문제