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

우측 상단에 버튼을 만들고 싶은데요

0 추천
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@android:color/black">

    <ImageView
        android:id="@+id/top_ui"
        android:layout_width="fill_parent"
        android:layout_height="60dp"
        android:background="@drawable/top_ui_9"
        android:layout_alignParentTop="true"/>

    <TextView
        android:id="@+id/top_ui_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@id/top_ui"
        android:layout_alignTop="@id/top_ui"
        android:layout_alignRight="@id/top_ui"
        android:layout_alignBottom="@id/top_ui"
        android:layout_margin="1dp"
        android:gravity="center"/>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:background="@drawable/cf_but_plus"/>
</RelativeLayout>

이미지를 못올리니 답답하네요.

글로적자면 백그라운드가 있고 중간에 그 탭화면 제목이 있구요

그 우측에 버튼을 만들고 싶은데....

이상하게 나오네요.

이 코드로 하면 생기긴 하는데 버튼이 좌우로 늘어져서 나와요. 약간 늘어진..

버튼 이미지는 정사각형인데말이죠.

SofKaints (560 포인트) 님이 2015년 7월 12일 질문

2개의 답변

0 추천
이미지 업로드하실 수 있습니다.

저렇게만 이야기 하시면 뭘 원하는지 알수가 없어요
하늘아륑 (16,800 포인트) 님이 2015년 7월 12일 답변
0 추천

무슨 말인진 모르겠는데 대충 왼쪽에 이미지 가운데에 텍스트 오른쪽에 버튼이 가야된다는거 아닌가요?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="co.kr.project.newgoo.MainActivity" >
 
    <ImageView
        android:id="@+id/top_ui"
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:layout_alignParentTop="true"
        android:background="@drawable/top_ui_9" />
 
    <TextView
        android:id="@+id/top_ui_text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@+id/btn"
        android:layout_toRightOf="@+id/top_ui"
        android:gravity="center" />
 
    <Button
        android:id="@+id/btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:background="@drawable/cf_but_plus" />
 
</RelativeLayout>
콜벳 (7,150 포인트) 님이 2015년 7월 13일 답변
...