마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

GridLayout 마음먹은대로 잘 안되는데 도움주세요.

0 추천

스크린샷처럼 만들려고 하는 초보개발자입니다. 잘 안되는데 이유를 모르겠습니다. 대칭도 잘 안맞고.

기획의도

 

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context=".MainActivity">


    <GridLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:columnCount="6"
        android:rowCount="9"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true">


        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="빠르고 안전한 상담"
            android:id="@+id/button1"
            android:layout_row="0"
            android:layout_column="0"
            android:layout_columnSpan="6"
            android:layout_gravity="center|fill"
            android:clickable="false" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="상품안내"
            android:id="@+id/button2"
            android:layout_row="1"
            android:layout_column="0"
            android:layout_columnSpan="3"
            android:layout_gravity="center|fill"
            android:layout_rowSpan="2" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="상담신청"
            android:id="@+id/button3"
            android:layout_row="1"
            android:layout_gravity="center|fill"
            android:layout_columnSpan="3"
            android:layout_rowSpan="2" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="앱소개"
            android:id="@+id/button4"
            android:layout_row="3"
            android:layout_column="0" />



        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="사례"
            android:id="@+id/button5"
            android:layout_row="3"
            android:layout_column="2" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="진행절차"
            android:id="@+id/button6"
            android:layout_row="3"
            android:layout_column="4" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="계산기"
            android:id="@+id/button7"
            android:layout_row="5"
            android:layout_column="0" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="금융사고예방"
            android:id="@+id/button8"
            android:layout_row="5"
            android:layout_column="2" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="신용관리 방법"
            android:id="@+id/button9"
            android:layout_row="5"
            android:layout_column="4" />

    </GridLayout>
</RelativeLayout>

센티넬 (120 포인트) 님이 2015년 8월 31일 질문

1개의 답변

0 추천
GridLayout은 잘 사용하지 않습니다.

LinearLayout 의 layout_weight 속성에 대해 조금만 검색해보시면

스샷대로 만드는건 일도 아닙니다.
중견수 (5,600 포인트) 님이 2015년 8월 31일 답변
답변 감사합니다. 중견수님.. 플라이는 다 중견수님께 날아가기를!!!
...