I have a typical login screen(table layout). What I would like to do is draw a rectangle around those controls and put gradient in it. How do I do that in xml ?
create gradient.xml
in /res/drawable
:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#FFFFFF"
android:endColor="#00000000"
android:angle="45"/>
</shape>
and in your layout file add android:background="@drawable/gradient"
to the propierties of the container where the controls are put in
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