私は自分の活動の一般的な背景を控えめに表現しようとしているので、ある隅に少量の紫、別の隅に少量の緑、非常に大きな白の帯を配置することにしました。それらの間の。
中央の色の幅を設定する方法がわからないので、レイヤーリストを使用して次の効果を試しました:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="0dp" android:left="0dp" android:bottom="0dp" android:right="0dp">
<shape android:shape="rectangle">
<size android:width="20dp"
android:height="20dp"/>
<solid android:color="#00000000"/>
</shape>
</item>
<item android:top="0dp" android:left="0dp" android:bottom="15dp" android:right="15dp">
<shape android:shape="rectangle">
<size android:width="1dp"
android:height="1dp"/>
<gradient
android:startColor="#00000000"
android:centerColor="#00000000"
android:endColor="#92ff16"
android:angle="135"/>
</shape>
</item>
<item android:top="15dp" android:left="15dp" android:bottom="0dp" android:right="0dp">
<shape android:shape="rectangle">
<size android:width="1dp"
android:height="1dp"/>
<gradient
android:startColor="#ff1692"
android:centerColor="#00000000"
android:endColor="#00000000"
android:angle="135"/>
</shape>
</item>
</layer-list>
これは Android Studio デザイナーでは問題ないように見えますが、アプリでは、dp フィギュアが非常に小さいにもかかわらず、色付きの四角形が重なっています。
角の形状を離す簡単な方法はありますか?