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

android:layout_weight 로 구성한 레이아웃 질문입니다.

0 추천
        <RelativeLayout
            android:orientation="horizontal"
            android:id="@+id/content"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#848484"
            android:rotation="180"
            >
            <LinearLayout
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >

                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:layout_marginTop="3dp"
                    android:background="#848484"/>


                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="8"
                    android:background="#848484"
                    >

                    <LinearLayout
                        android:orientation="vertical"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="0dp"
                            android:layout_weight="0.7"
                            android:gravity="center"
                            >

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:id="@+id/textname222"
                                android:textSize="20dp"
                                android:layout_gravity="center_horizontal"
                                android:textColor="#FFFFFF"/>

                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="0dp"
                            android:layout_weight="13"
                            android:isScrollContainer="true">

                            <EditText
                                android:padding="3dp"
                                android:id="@+id/bodytext"
                                android:layout_width="match_parent"
                                android:layout_height="match_parent"
                                android:layout_marginRight="10dp"
                                android:layout_marginLeft="10dp"
                                android:layout_marginBottom="10dp"
                                android:textSize="15dp"
                                android:scrollbars="vertical"
                                android:layout_alignParentBottom="true"
                                android:gravity="top|left"
                                android:enabled="false"
                                android:background="#FFFFFF"/>

                        </LinearLayout>

                    </LinearLayout>
                </LinearLayout>

            </LinearLayout>
        </RelativeLayout>

원활한 의사소통을 위해 그림으로 설명 했습니다. 

현재는 layout_weight로 레이아웃을 구성했기 때문에, 키보드가 팝업되면 A네모칸도 줄어들게 됩니다.

제가 원하는 것은 layout_weight 으로 구성하면서 키보드가 팝업됐을 때 A네모칸이 줄어들지 않는 것인데

몇주 넘게 제대로 해결하지 못하고 있습니다. 해결 방법이 있을까요?

A네모칸 만큼은 화면의 비율로 유지를 하고 싶습니다. 

초보개발자 님이 2016년 1월 25일 질문

1개의 답변

0 추천
layout_wight는 각 layout의 비율이기 때문에 layout_wight를 유지하면서 원하시는 것을 구현하기는 여렵지 않나 싶습니다. 크기 고정을 원하시는 거라면 layout_height로 하시고 화면 크기 비율대로 하고 싶으시면 linearlayout이나 relativelayout을 두개로 쪼개서 해 보시는 게 좋을것 같네요.



http://stackoverflow.com/a/3996104/5815376
Anno (290 포인트) 님이 2016년 1월 26일 답변
...