2011-03-27 2 views
3

버튼이있는 GridView가 있습니다. 버튼을 눌러야합니다 (작동 중). 그러나 많은 항목이 포함 된 gridview를 스크롤하려면 HTC Desire에서 작동하지 않지만 에뮬레이터에서는 가능합니다.오직 버튼으로 GridView 스크롤하기

내의 GridView :

<GridView 
    android:id="@+id/gv_control_group" 
    android:layout_height="wrap_content" 
    android:isScrollContainer="true" 
    android:layout_width="fill_parent" 
    android:numColumns="auto_fit" 
    android:verticalSpacing="10dp" 
    android:horizontalSpacing="10dp" 
    android:stretchMode="columnWidth" 
    android:gravity="center" 
    android:scrollingCache="true" 
/> 

GridViewItem :

<LinearLayout 
    android:id="@+id/gi_socket" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:gravity="center_horizontal"> 

<Button 
    android:id="@+id/gi_btn" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:drawableTop="@drawable/green" 
/> 
</LinearLayout> 

두 번째 질문 : 가 어떻게 장치를 회전 할 때의 GridView가 서로 옆에 더 많은 항목을 표시 할 수 있습니다. 2.1 모든 작품에 그것은 에뮬레이터에서 안드로이드 2.2 문제의

: 지금은 단지

android:stretchMode="none" 

편집 작동하지 않는 전체 폭이 개 항목을 ... 뻗어. 그러나 Android 2.2에서는 더 이상 스크롤 할 수 없습니다 ... 2.2에서 스크롤 할 수있는 해결 방법이 있습니까? 당신이 /의 경우 움직임을 감지 event을 스크롤 떠나 event 당신의 GridView 또는 그것이 경우 버튼의 클릭이를 통과 할 수 있도록

답변

관련 문제