1
화면을 나누는 방법, match_parent를 사용하여 두 개의 버튼으로 너비를 조절하는 방법. 나는 match_parent를 버튼에주고 화면을 채 웁니다. 두 개의 버튼이 화면을 가로로 채우고 싶습니다.화면을 두 개의 버튼으로 나누는 방법은 무엇입니까?
화면을 나누는 방법, match_parent를 사용하여 두 개의 버튼으로 너비를 조절하는 방법. 나는 match_parent를 버튼에주고 화면을 채 웁니다. 두 개의 버튼이 화면을 가로로 채우고 싶습니다.화면을 두 개의 버튼으로 나누는 방법은 무엇입니까?
당신은
그래서 우선
는 선형 레이아웃 지금, fill_parent로 폭을 제공 2. 로 weighSum 속성을 추가 걸릴 ... 무게와없는 랩 컨텐츠/일치 부모 등로를 사용하여 폭을 분할해야 :지금
전체 코드가 여기에있다 .... layout_width = 0dp
와 2 개 버튼을 추가하고 두 버튼에 layout_weight를 = 1을 추가
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="2" >
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Aamir Shah" />
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Aamir Shah" />
</LinearLayout>
이 사이트의 검색 창을 사용하십시오 - http://stackoverflow.com/questions/2698817/linear-layout-and-weight-in-android – kellogs