마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

뜨억 ㅠㅠ 아래의 예제 구현이 어렵습니다 ㅠㅠ

0 추천

 안녕하세요 ..

아래의 예제를 보고, 제 나름대로 코드를 만드는데.. 리니어 레이아웃

바탕화면 3가지 색상만 되고, 그 안에 토글버튼이라던지, 라디오버튼이라

던지 텍스트 부분은 어떻게 해결을 해야 할지 잘 모르겠어요 ㅠㅠ ..

어떻게 해야 할까요 ㅠㅠ

도움을 좀 부탁드려요 ㅠㅠ

 

Kind카인드 (3,600 포인트) 님이 2016년 10월 4일 질문

2개의 답변

0 추천
 
채택된 답변

정렬 검색하시면 쉽게 하실듯 합니다..

http://blog.naver.com/PostView.nhn?blogId=babobigi&logNo=40198454176

앤드류이드 (6,190 포인트) 님이 2016년 10월 4일 답변
Kind카인드님이 2016년 10월 8일 채택됨
하아 ㅠㅠ.. 말씀해주신, 블로그와 구글에서 여러 부분을 참조해도 왜이렇게 안되는지 ㅠㅠ 윽 ㅠㅠ..
0 추천

이렇게 한번 해보세요. 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>

 

spark (227,910 포인트) 님이 2016년 10월 5일 답변
...