i want something like following image
i tried it using drawable shape
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:angle="360" android:centerX="50%" android:centerY="50%" android:gradientRadius="50%" android:endColor="#000000" android:centerColor="#FFFFFF" android:startColor="#000000" > </gradient> </shape>
attributes: android:angle Integer. The angle for the gradient, in degrees. 0 is left to right, 90 is bottom to top. It must be a multiple of 45.
Make a new Android xml file (say GreyRadial.xml) file in your drawable folder
In your xml file
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:centerColor="#c1c1c1" android:endColor="#4f4f4f" android:gradientRadius="400" android:startColor="#c1c1c1" android:type="radial" > </gradient> </shape>
Use this xml in your layout background using
android:background="@drawable/GreyRadial"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With