안녕하세요 코딩하다가 책에 적힌내용과 다르게 출력이되서 ...제가 잘못한거진 고수님들한테 여쭙고 싶네요 ...
아래 그림에서
노랑에 android:layout_weight="2"
파랑에 android:layout_weight="1"
을 각각 주었습니다.
제가 생각한대로라면 노랑이 2/3을 차지하고 파랑이 1/3 을 차지해야되는데 ...
어찌된건지 ....반대가 되어 출력이 되네요 ...제가 잘못한건지 ..버그인건지 ..고수님 시원한 답변 부탁드립니다.ㅠㅠ
아래에 xml 소스도 가치 첨부하였습니다.
---------------------------------------------------------------------------------------------------------------
xml
---------------------------------------------------------------------------------------------------------------
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF0000"
android:orientation="vertical"
android:layout_margin="10dp">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00FF00"
android:orientation="horizontal"
android:layout_margin="20dp"
android:baselineAligned="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFF00"
android:orientation="vertical"
android:layout_weight="2"
android:layout_margin="10dp" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0000FF"
android:orientation="vertical"
android:layout_weight="1"
android:layout_margin="10dp">
</LinearLayout>
</LinearLayout>
</FrameLayout>