2
你好我試圖繪製有三個長方形的形狀: 1.純色2.等級3.白線,我該怎麼辦呢?當我嘗試這個時,它不起作用。佈局具有父級顏色。嵌套形狀
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:height="60px"
>
<shape
android:shape="rectangle"
android:height="30px"
>
<solid
android:color="#ff297baf"
/>
</shape>
<shape
android:shape="rectangle"
android:height="30px"
>
<gradient
android:type="linear"
android:startColor="#ff297baf"
android:endColor="#ff16c0e3"
android:angle="270"/>
</shape>
<shape
android:shape="rectangle"
android:height="3px"
>
<solid
android:color="#FFFFFFFF"
/>
</shape>
</shape>
我想使3種顏色的漸變。以純色開始#ff297baf
,在60%處開始從#ff297baf
到#ff16c0e3
的漸變,並在最後添加一行。
這裏需要給予更多的信息。你有迄今爲止嘗試的代碼示例嗎?爲什麼你需要一個純色和漸變?它是一個透明的漸變疊加?白線,這是一個輪廓?它應該放在形狀內嗎? – kcoppock 2010-12-10 22:07:15
請將您的評論添加到問題中並進行格式化。 – 2010-12-10 23:42:24
其不透明覆蓋。白線是一個輪廓。通常我會在HTML中執行此操作:「border-bottom:solid 2px white」。它不必在裏面做,但我不能在視圖上獲得任何其他形狀。編譯器抱怨應該是root。 –
dropsOfJupiter
2010-12-11 00:03:37