선형 XML 드로어 블을 LinearLayout의 배경으로 사용하고 있습니다.모양 XML 드로어 블을 비트 맵 XML 드로잉으로 파싱 할 수 없습니다.
파일 :
: background.xml 다음
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:angle="270"
android:endColor="@color/bg_end_blue"
android:startColor="@color/bg_start_blue" />
<corners android:radius="0dp" />
</shape>
내가 디더링 방법이 (이 문서 http://android.amberfog.com/?p=247을 통해)이 배경의 모양을 향상시킬 수에 대해 읽어, 따라서 나는이 비트 맵 XML 드로어 블을 생성 파일 : background_bitmap.xml
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:dither="true"
android:src="@drawable/background"
android:tileMode="repeat" />
그리고 LinearLayout에 적용 해 보았습니다. 하지만 얻을 :
org.xmlpull.v1.XmlPullParserException: Binary XML file line #5: <bitmap> requires a valid src attribute
내가 뭘 잘못하고 있는지 알아? 미리 감사드립니다 !!
에는 유효한 src 특성이 필요합니다. 그 배경은 유효한 것입니까? –
예. 레이아웃의 배경으로 초기 모양 드로어 블을 사용했는데 정확했습니다. –
위의 링크에서이 줄을 발견했습니다. 'Android의 디더링은 신축성 또는 타일 이미지에만 적용되기 때문에. 왜? 나는 모른다. 당신이 알고 있다면 - 나를 써주세요. 나중에 플랫폼 코드를 살펴볼 것입니다.) '. 이미지 뷰에서 한 번 시도해보고 작동 여부를 확인하십시오. –