선형 레이아웃을 배우고 있는데 혼란이 있습니다.android의 선형 레이아웃 arangment
<LinearLayout 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:orientation="vertical"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello_world"
android:layout_weight=".33"/>
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight=".33"/>
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight=".3"/>
</LinearLayout>
이 코드에는 세 가지 요소가 있습니다.
- 텍스트 뷰 2. 3. Button1을 Button2를
선형 배열 방향이 수직이고, I는 그들을 하나 개의 가중치 값을 조정 동일한 가중치를 부여했다.
이제 수직 방향으로 나는 그래서 높이와 너비를 모두 채우는
android:layout_width="fill_parent"
android:layout_height="wrap_content"
을 제공하고 있어요.
하지만 수평 레이아웃을 사용하고 그것은 폭을 채우는
android:layout_height="fill_parent"
android:layout_width="wrap_content"
처럼 쓰고 있지만
높이
을 채우는 대신 안드로이드를 포기하지 않을거야 때 : layout_height = "fill_parent는"왜 높이를 작성하지?
은 당신이 만든 어떤 변화가 뜻이 게시물을 참조 나에게 난 그냥 방향을 변경 –
아무것도 말할하십시오 - 수평 및이 두 줄을 각보기 안드로이드 : layout_width = "wrap_content" android : layout_height = "fill_parent" – Nirali