-1

내 목록보기 항목에 9patch 배경을 만들려고했으나 9patch로 이미지를 수정 한 이후 배경이 흐려 전체 이미지를 볼 수 없게되었습니다.목록 항목 배경 늘어짐 9patch 안드로이드

다음

enter image description here

내 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이 :

나는이 문제를 해결할 수있는 방법을

enter image description here

사람이 알고 있나요?

+1

이 파일을 보면, 귀하의 9patch가 정확하지 않다고 믿습니다. 'draw9patch' 또는 유사한 도구로 검사 해 보았습니까? – curtisLoew

+1

http://romannurik.github.io/AndroidAssetStudio/nine-patches.html 여기에 9 개의 패치 이미지를 생성하십시오 –

+0

'어떻게이 문제를 해결할 수 있습니까? ** ** **! 원하는 결과는 무엇입니까? ** 1 ** - 원은 둥근 사각형이어야하고 ** 텍스트가 포함되어야합니다 ** (더 세게) ** ** ** ** 원은 그대로 유지되고 ** 총알처럼 작동합니다 ** (더 쉽게)? –

답변

0

나인 패치 NinePatch에게 내가 코너의 라인 그래서 은 그것을 무시 제거 할 수 없습니다 당신에게 도움이 될 수있는 아래와 같은 이미지 .... ........... 를 ... 만들기

검은 선이 여기에 이미지 streching입니다 ....... 에 사용되는

주 ...

왼쪽 _top : 이미지를 streaching에 사용됩니다 ..... 오른쪽 하단은 : 내용 영역을 설정하기 위해 사용된다 귀하의 텍스트가 설정됩니다 ...

관련 문제