Tho*_*art 1 android gradient background android-relativelayout
自从我将我的设备更新为 android 10 以来,我的背景渐变之一面临着一个奇怪的问题。
我有一个带有渐变背景的 RelativeLayout 看起来像这样。
<RelativeLayout
android:id="@+id/layoutSpeedLegend"
android:layout_width="match_parent"
android:layout_height="18dp"
android:background="@drawable/background"/>
Run Code Online (Sandbox Code Playgroud)
我的 background.xml 看起来像这样。
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient
android:centerColor="@color/yellow"
android:endColor="@color/red"
android:startColor="@color/darkgreen"
android:centerX="50%"/>
<corners android:radius="15dp" />
</shape>
</item>
Run Code Online (Sandbox Code Playgroud)
添加android:angle="90"到我的 background.xml 也不起作用。
有人知道为什么会这样吗?
| 归档时间: |
|
| 查看次数: |
493 次 |
| 最近记录: |