2013-01-24 2 views
15

내 이미지 뷰의 오른쪽 상단 모서리에 확인 표시를해야합니다. 하지만 이렇게하면 내 체크 박스 주변에 기본 여백이 있음을 알게되었습니다. 이것을 제거하는 방법이 있습니까 ??Android CheckBox에서 패딩 제거하는 방법

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 

    <FrameLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" > 

     <ImageView 
      android:id="@+id/thumbImage" 
      android:layout_width="100dp" 
      android:layout_height="132dp" 
      android:layout_gravity="center" /> 
    </FrameLayout> 

    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentTop="true" 
     android:background="#ff0000" 
     android:gravity="center" > 

     <CheckBox 
      android:id="@+id/itemCheckBox" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentEnd="true" 
      android:layout_gravity="center" 
      android:button="@drawable/checkbox_background" 
      android:paddingLeft="0dp" 
      android:paddingTop="0dp" /> 

    </LinearLayout> 

</RelativeLayout> 

답변

12

음수 여백을 사용할 수 있습니다.

android:layout_marginTop = "-5dp" 
android:layout_marginRight = "-5dp" 
+1

가 알고 있어야 더 의심을 어떤 문제에 직면하거나이 있으면 알려 주시기 마십시오. – azizbekian

-1

네거티브 패딩과 모두를 복잡하게 만드는 이유는 무엇입니까? 간단하고 직선적 인 방법으로, FrameLayout에 패딩을 주어야합니다. 대신 트릭을 수행하는 최상위 레이아웃을 사용하십시오. 두 번째 레이아웃의 CheckBox 만 있으면 패딩을 줄 필요가 없습니다.

에스프레소 체크 박스의 "90 % 이상을 볼 수 없습니다"때문에 검사가 실패 할 수 있습니다, 당신은

+0

이슈에서 필요한 것은 패딩이 아니고 이미 제거해야하는 패딩이 있기 때문입니다. 이것은 틱의 꼬리가 체크 박스를 넘는 오래된 안드로이드 버전에서만 발생합니다 – Lincy

+0

어쨌든 고마워요. 저에게 효과가있는 유일한 방법입니다. – Lincy

관련 문제