0
這個link包含一個圖像,它具有純藍色背景,光線朝向圖像的中心。如何使用聚焦於Android Studio中的Android活動中心的光設置背景色?
如何在Android Studio中爲一個活動設置類似的背景顏色,而不使用'drawable'?
這個link包含一個圖像,它具有純藍色背景,光線朝向圖像的中心。如何使用聚焦於Android Studio中的Android活動中心的光設置背景色?
如何在Android Studio中爲一個活動設置類似的背景顏色,而不使用'drawable'?
嘗試爲了得到這種效果這
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:type="radial" android:gradientRadius="250"
android:startColor="your_color" android:endColor="your_color" />
</shape>
使用梯度繪製。根據要求替換startColor & endColor &確保顏色值具有不透明度參數。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:type="radial" android:gradientRadius="300"
android:startColor="#3bffffff"
android:endColor="#72000000" />
</shape>
android:background =「@ drawable/imageNameInDrawableFolder」 – Stallion
@Aishwarya using gradient drawable – Nisarg