-1
내 목록보기 항목에 9patch 배경을 만들려고했으나 9patch로 이미지를 수정 한 이후 배경이 흐려 전체 이미지를 볼 수 없게되었습니다.목록 항목 배경 늘어짐 9patch 안드로이드
다음내 item.xml 코드 : 는 여기에 내가 수정 한 이미지입니다
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/toggle"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="@+id/item_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|left"
android:textColor="@android:color/black" />
</LinearLayout>
과에 따라 적절한 이미지를 보여주는 내 토글 선택 목록 항목 상태 :
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/item_normal"></item>
<item android:state_selected="true" android:drawable="@drawable/item_selected"></item>
<item android:state_focused="true" android:drawable="@drawable/item_normal"></item>
<item android:state_activated="true" android:drawable="@drawable/item_selected"></item>
<item android:state_activated="false" android:drawable="@drawable/item_normal"></item>
<item android:state_active="true" android:drawable="@drawable/item_selected"></item>
<item android:state_active="false" android:drawable="@drawable/item_normal"></item>
</selector>
백그라운드의 전체 이미지 대신 gettings이 :
나는이 문제를 해결할 수있는 방법을사람이 알고 있나요?
이 파일을 보면, 귀하의 9patch가 정확하지 않다고 믿습니다. 'draw9patch' 또는 유사한 도구로 검사 해 보았습니까? – curtisLoew
http://romannurik.github.io/AndroidAssetStudio/nine-patches.html 여기에 9 개의 패치 이미지를 생성하십시오 –
'어떻게이 문제를 해결할 수 있습니까? ** ** **! 원하는 결과는 무엇입니까? ** 1 ** - 원은 둥근 사각형이어야하고 ** 텍스트가 포함되어야합니다 ** (더 세게) ** ** ** ** 원은 그대로 유지되고 ** 총알처럼 작동합니다 ** (더 쉽게)? –