在Android中应在哪个文件夹/文件中定义背景渐变?

问题描述

| 我正在尝试将此渐变代码添加到colors.xml中,但是Eclipse一直说“无效的开始标签形状” projname / values / colors.xml(当前在这里)
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" 
       android:shape=\"rectangle\">
<gradient 
 android:type=\"radial\" 
 android:gradientRadius=\"400\"
 android:startColor=\"#88cce7\"
 android:endColor=\"#075e81\"/>
</shape>
<resources>
  <color name=\"bg_red\">#FF0000</color>
  <color name=\"bg_white\">#FFFFFF</color>
  <color name=\"bg_black\">#000000</color>
  <color name=\"opaque_red\">#f00</color>
  <color name=\"translucent_red\">#80ff0000</color>
</resources>
例如这是我尝试模仿的渐变:http://i.stack.imgur.com/YMbNR.png     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)