Reputation: 3
I am trying to make the gradient in my activity the following way:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#c0c0c0"
android:endColor="#ffffff"
android:angle="270"/>
</shape>
The bottom part of the gradient should have the same color as the activity and views background. And I quickly realize that #ffffff
(white) color is not actually background color in my application! I have made the screenshot and discovered that background is actually #ececec
color.
So is there a way to use current system/theme/style background color in my XML files? I don't want to use hardcoded #ececec
color because it can be different on other devices and/or Android versions...
Upvotes: 0
Views: 324