두 개의 열이있는 격자보기가 있습니다. 표보기 행 항목에 대해 다른 색상을 설정하고 싶습니다. 예를 들어, 네 번째 행 항목마다 4 색을 번갈아 가며 적용하고 싶습니다.android에서 gridview 행 항목에 다른 색상을 적용하는 방법은 무엇입니까?
android:background="@color/dividerColor"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.6"
android:padding="8dp">
<GridView
android:id="@+id/gridCategory"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="2"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center">
</GridView>
</LinearLayout>
당신은 위치 – Chol
@Abhilash Harsole에 따라 사용자 정의 어댑터를 할 수있는 당신이이 솔루션을 시도했다가 HTTP : //stackoverflow.com/questions/18961709/how-to-set-alternate-row- color-in-a-gridview-android? rq = 1 – PN10