2017-07-31 112 views

回答

5

我建議使用可繪製的<vector>

<vector 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:width="24dp" 
    android:height="8dp" 
    android:viewportWidth="24.0" 
    android:viewportHeight="24.0"> 

    <path 
     android:fillColor="#FFff0000" 
     android:pathData="M24 24v-24h-24v24a20 36 0 0 1 24 0z"/> 

</vector> 

後的「一」與前兩個數字播放左右(即a20 36)將讓你控制曲線的精確形狀。

enter image description here

+0

在使用中的畫布,我可以請知道在哪裏可以進行更改,使曲線倒掛? –

+0

@ Rat-a-tat-a-tatRatatouille你的意思是你想垂直翻轉整個形狀(以便在矩形的頂部有一條凹曲線),或者你想使曲線凸起而仍然在矩形的底部)? –

+0

是的,我希望它凸起..所以曲線不能在底部,但翻轉。 –

0

您應該爲此圖像使用九個補丁。您可以使用AndroidAssetStudio從Roman Nurik創建的任何源生成九個補丁。