【发布时间】:2011-08-21 13:40:57
【问题描述】:
我目前正在使用以下代码将径向渐变应用到视图的背景:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:type="radial"
android:gradientRadius="250"
android:startColor="#479637"
android:endColor="#3e6d34"
/>
</shape>
当软键盘出现在屏幕上时,会出现问题,然后调整视图大小并重新绘制渐变以适应较小的视图。
有没有办法阻止这种情况发生,使径向渐变看起来不会改变,而不使用图像作为背景。我尝试使用android:centerX 和android:centerY,但它们不允许我在倾斜方面给出中心。
如果我的问题不清楚,我可以发布一张图片来解释问题。
提前感谢您的帮助。
【问题讨论】:
标签: android layout background gradient radial