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

한 레이아웃 안에, 버튼 왼쪽에 이미지버튼을 배치하고싶은데..

0 추천

안녕하세요 ..

한 렐러티브 레이아웃 안에, 버튼 왼쪽에 이미지버튼을 배치하고 싶은데 쉽지가 않아요 ㅠ ㅠ..

 

어떻게 해야할까요 ..ㅠㅠ  소스한번 첨부해보겠습니다 ㅠ 

그리고 아래에 쓰이는 사진의 이미지는 맨 아래의 숫자 15 이미지입니다.

 

<RelativeLayout
    android:id="@+id/One_Space"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#0fdcc7"
    android:layout_above="@+id/First_toolbar_bottom"
    android:layout_below="@+id/First_Movie_Toolbar">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#ff0000"
        android:paddingBottom="1dp"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="예매율 1 28.5%"
        />


        <Button
            android:id="@+id/btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="무대인사 일정 안내"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentTop="true"
            />

        <ImageButton
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            
            android:background="@drawable/aaa"

            android:layout_alignParentTop="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true" />


    </RelativeLayout>


</RelativeLayout>
 
Kind카인드 (3,600 포인트) 님이 2016년 10월 21일 질문
아래와 같이 해결했는데 이게 좋은방법인지 궁금합니다..

<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/activity_first__movie"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context="com.example.svc.dddddddddddddd.MainActivity">

        <RelativeLayout
            android:id="@+id/First_Movie_Toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true">

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="3dp"
                android:text="옵션"/>

        </RelativeLayout>


        <RelativeLayout
            android:id="@+id/One_Space"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#0fdcc7"
            android:layout_above="@+id/First_toolbar_bottom"
            android:layout_below="@+id/First_Movie_Toolbar">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff0000"
                android:paddingBottom="1dp"
                android:layout_alignParentTop="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true">

                <Button

                android:id="@+id/Left_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/white_round_button"
                android:text="생존율 1위 28.5%"
                />


                <Button
                    android:id="@+id/Right_btn"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="사망인사 일정 안내"
                    android:layout_alignParentRight="true"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentTop="true"
                    />

                <ImageButton
                    android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:layout_toRightOf="@+id/Left_btn"

                    android:background="@drawable/aaa"

                    android:layout_alignParentTop="true"
                    android:layout_toLeftOf="@+id/Right_btn"
                    android:layout_toStartOf="@+id/Right_btn" />


            </RelativeLayout>

        </RelativeLayout>



        <RelativeLayout
            android:id="@+id/First_toolbar_bottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true">

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="3dp"
                android:text="설치비용"/>

        </RelativeLayout>

    </RelativeLayout>

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...