문제

Android 앱에 시끄러운 배경을 추가하려고합니다. 텍스처는 완벽하고 9patch 이미지를 만들 수 있지만 실제로 앱에서 사용하면 배경 전체에 선이 발생합니다. 이러한 유형의 텍스처를 구현하는 데 더 나은 방법이 무엇인지 아십니까?

또한 액션 바에 비슷한 것을 사용하려고합니다.

NoisyGrey

도움이 되었습니까?

해결책

9 패치가 늘어나고 이미지에서 어떤 영역이 늘어야하는지 지정해야합니다. 왜 당신은 당신의 그림을 반복하려고하지 않습니다. 그렇게 :

<xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/YourLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/backrepeat"
>

그런 다음 xml에서 backrepeat.xml이라고합니다

<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/back" 
    android:tileMode="repeat" />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top