Android计量单位有什么区别?
user-interface android units-of-measurement dimension android-layout
我正在尝试使用径向渐变背景创建一个可绘制的形状,半径将根据屏幕大小进行调整(请参阅相关文档).
这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:endColor="#000"
android:gradientRadius="50%p"
android:startColor="#5d2456"
android:type="radial" />
</shape>
Run Code Online (Sandbox Code Playgroud)
但它似乎没有用.如果我删除"%p",它可以工作,但是半径将是静态的,因此不会调整到屏幕尺寸......任何想法有什么问题?