안녕하세요 ..
아래의 예제를 보고, 제 나름대로 코드를 만드는데.. 리니어 레이아웃
바탕화면 3가지 색상만 되고, 그 안에 토글버튼이라던지, 라디오버튼이라
던지 텍스트 부분은 어떻게 해결을 해야 할지 잘 모르겠어요 ㅠㅠ ..
어떻게 해야 할까요 ㅠㅠ
도움을 좀 부탁드려요 ㅠㅠ
정렬 검색하시면 쉽게 하실듯 합니다..
http://blog.naver.com/PostView.nhn?blogId=babobigi&logNo=40198454176
이렇게 한번 해보세요. LinearLayout의 gravity만 잘 조절하면 되는데요.
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:background="#ff0000" android:layout_weight="2" android:gravity="center" android:orientation="vertical"> <ToggleButton android:text="ToggleButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/toggleButton2" /> <ToggleButton android:text="ToggleButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/toggleButton" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:background="#00ff00" android:layout_weight="1" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="TextView1"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="TextView2"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="TextView3"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:background="#0000ff" android:layout_weight="3" android:gravity="right|bottom" android:orientation="vertical"> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" tools:text="RadioButton1"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" tools:text="RadioButton2"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" tools:text="RadioButton3"/> </LinearLayout> </LinearLayout>