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

layout 설정하는 방법좀 알려주세요

0 추천

위와 같은 식으로 1080 * 1920 에 맞추어 layout을 구현하고 싶은데..

잘 되지 않네요..

어떤식으로 해야하는지 궁금합니다.ㅠㅠㅠ

 

각자리에 들어갈것은 Textview나 ImageView나 Imagebutton만 있습니다,

쿠쿠부다스 (6,470 포인트) 님이 2016년 12월 26일 질문

1개의 답변

0 추천
LinearLayout 를 이용하면 간단할 듯 한데요.

android:layout_weight 비율로 조절한 예제입니다.

android:layout_weight 대신 android:layout_height 값을 android:layout_height="215px" 같이 직접 입력 해 주셔도 됩니다.

 

 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
     <LinearLayout       android:layout_width="match_parent"
                    android:layout_height="0dp"
                android:layout_weight="215" />
     <LinearLayout       android:layout_width="match_parent"
                    android:layout_height="0dp"
                android:layout_weight="850" />
     <LinearLayout       android:layout_width="match_parent"
                    android:layout_height="0dp"
                android:layout_weight="270" />
     <LinearLayout       android:layout_width="match_parent"
                    android:layout_height="0dp"
                android:layout_weight="270" />
     <LinearLayout       android:layout_width="match_parent"
                    android:layout_height="0dp"
                android:layout_weight="270" />
</LinearLayout>
익명사용자 님이 2016년 12월 26일 답변
해봤는데 딱 떨어지지는 않네요 ㅠㅠ
화면 해상도가 맞는지 확인 해보세요...  타이틀바나, 버튼등으로 인해 1080 * 1920 가 아니거나 특정 도형이 사이즈를 잡아먹는 듯 합니다.
 ScalableLayout를 사용해 보시는 것도 방법일듯은 하네요..
http://www.androidpub.com/index.php?_filter=search&mid=android_dev_info&search_target=title&search_keyword=layout&document_srl=2573998
ScalableLayout사용해봤습니다.
그런데 LG폰일경우에는 뒤로가기 및 홈버튼이 소프트웨어 버튼으로 되어있어서 그런지 하단부가 짤리더라구요.. ㅠㅠ
...