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

화면 레이아웃 문의드립니다

0 추천

화면을 분할해서 작업할려고 하는데 Fragment 를 사용하면 되나요?

고수님들은  보통 어떻게 작업을하는지 궁금합니다.

제가 작성한 xml입니다.

activity_main.xml 에서

<RelativeLayout....

<fragment
        android:id="@+id/fragment1"
        android:name="com.example.layout.FragementOneActivity"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true" />
 
    <fragment
        android:id="@+id/fragment3"
        android:name="com.example.layout.FragementThreeActivity"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/fragment1" />
 
    <fragment
        android:id="@+id/fragment2"
        android:name="com.example.layout.FragementTwoActivity"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@id/fragment1" />
 
    <fragment
        android:id="@+id/fragment4"
        android:name="com.example.layout.FragementFourActivity"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/fragment3"
        android:layout_alignLeft="@id/fragment3" />
 
</RelativeLayout>

이렇게 나오는데요 제가 원하는 레이아웃은

이렇게 화면에 보여주고 싶습니다 ㅋㅋㅋ 각각에 사이즈를 어떻게 조절해야할지 모르겠습니다 ㅠㅠ

울트라짱가 (180 포인트) 님이 2014년 3월 18일 질문

1개의 답변

+1 추천
저 그림이라면 프래그먼트를 떠나서 일단 리니어레이아웃으로 만들거같은데요.

weight을 적절히 사용해서요
q1212 (26,020 포인트) 님이 2014년 3월 18일 답변
...