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

Notification Layout 수정 방법

0 추천

Custom Notification 구현하고 있습니다.

X표시를 오른쪽 상단으로 옮기고 싶은데.. 어떻게 해야할지 잘 몰라서 이렇게 글을 남깁니다.

아래는 Layout xml 입니다.

 

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#ffffff"
    android:padding="10dp" >
    
    <ImageView android:id="@+id/image"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_marginRight="10dp" />
    <TextView android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/image"
        android:textColor="#000000"
        style="Custom Notification Title" />
    <TextView android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/image"
        android:textColor="#000000"
        android:layout_below="@id/title"
        style="Custom Notification Text" />
    
    <ImageButton 
          android:id="@+id/finish_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/text"
        android:layout_gravity="right|top"
        android:background="@drawable/x"/>
  
        
    
</RelativeLayout>

 

쿠쿠부다스 (6,470 포인트) 님이 2017년 1월 25일 질문

1개의 답변

0 추천

    <ImageButton 
          android:id="@+id/finish_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/text"
        android:layout_gravity="right|top"
        android:background="@drawable/x"/>

 

속성에

align_parentRight="true"

속성 추가해 주시면 됩니다.

모나미153 (17,540 포인트) 님이 2017년 1월 25일 답변
...