동일한 '행'에 두 개의보기가 있고 너비가 "fill_parent"인 Android의 경우보기 크기는 어떻게 계산됩니까?layout_width = "match_parent"인 Android RelativeLayout 및 하위
는예 :
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<EditText
android:id="@+id/EditText01"
android:hint="Enter some text..."
android:layout_alignParentLeft="true"
android:layout_width="match_parent"
android:layout_toLeftOf="@+id/Button01"
android:layout_height="wrap_content"></EditText>
<Button
android:id="@+id/Button01"
android:text="Press Here!"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"></Button>
</RelativeLayout>
이 코드는 글고 모든 여유 공간을 제공하고 자신의 오른쪽에있는 버튼을 보여줍니다. 이것은 글고 모든 폭을 채우고 변경하고 버튼을 화면 벗어나으로하지만 다음 Button
왼쪽에 정렬하는 EditText
의 경계 오른쪽 강제
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<EditText
android:id="@+id/EditText01"
android:hint="Enter some text..."
android:layout_alignParentLeft="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"></EditText>
<Button
android:id="@+id/Button01"
android:text="Press Here!"
android:layout_width="wrap_content"
android:layout_toRightOf="@+id/EditText01"
android:layout_height="wrap_content"></Button>
</RelativeLayout
덕분에, 지금은 이해합니다. 나는 너를 투표 할 수 없다 : ( – juan
미래에 너는 되돌아 올 수 있었다 :) 그리고 너는 환영 받는다 – TronicZomB