GridView

CODEDRAGON Development/Android

반응형


 


GridView

·       객체들을 고정된 개수의 열들로 이루어진 격자(grid)형태로 배치시킵니다.

·       격자의 칸에 이미지 아이콘이 배치되는 경우가 많습니다.

·       사용자는 항목을 선택해서 일정한 작업을 수행할 있습니다.

·       리스트뷰나 스피너는 1차원적인 데이터를 표시하지만 그리드뷰는 행과 열이 있는 2차원적인 데이터를 보여줍니다.

 

<LinearLayout

       xmlns:android="http://schemas.android.com/apk/res/android"

       android:orientation="vertical"

       android:layout_width="fill_parent"

       android:layout_height="fill_parent"

       > 

       <TextView

             android:id="@+id/selection"

             android:layout_width="fill_parent"

             android:layout_height="wrap_content"

             />

       <GridView

             android:id="@+id/grid"

             android:layout_width="fill_parent"

             android:layout_height="fill_parent"

             android:verticalSpacing="35dp"

             android:horizontalSpacing="5dp"

             android:numColumns="auto_fit"

             android:columnWidth="100dp"

             android:stretchMode="spacingWidth"

             android:gravity="center"

             android:drawSelectorOnTop="false"

             />

</LinearLayout>

 

 



반응형

'Development > Android' 카테고리의 다른 글

RecyclerView 도식도  (0) 2019.03.06
RecyclerView(리사이클러뷰)  (0) 2019.03.06
ListView (리스트 뷰) 목록 작업 단계  (0) 2019.03.05
ArrayAdapter  (0) 2019.03.05
ArrayList  (0) 2019.03.05