xml로 지정할 수 있습니다.
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<!-- end colour at top, start colour at bottom -->
<!-- Your colors can include hex alpha values -->
<!-- #ff000000 is fully transparent black -->
<!-- #00000000 is non transparent black -->
<!-- There are more options in that link to control the gradient more -->
<gradient
android:type="radial"
android:endColor="@color/endColor"
android:startColor="@color/startColor"/>
</shape>
</item>
<!-- top, bottom left and right adds padding -->
<item android:bottom="3px">
<Bitmap src="@drawable/yourBitmap />
</item>
</layer-list>
다음은 xml 드로어 블에 대한 자세한 정보와 훌륭한 링크입니다. http://idunnolol.com/android/drawables.html
클래스 중간에 어떻게 구현하나요? XML에 대한 액세스 권한이 없다고 가정 해보십시오. –
귀하의 초기 질문에이를 명시해야합니다. Java 객체에 매핑이 무엇인지 알려주는 링크를 사용하십시오. 비트 맵 아래에 그라데이션 배경이있는 LayerList를 만드는 것뿐입니다. 모든 XML 태그에는 Java 객체가 연결되어 있습니다. –
어떻게 구현해야할지 모르겠다. 자바 코드 (객체 등)로 내 앱을 다 만들었다. –