可繪制物件未顯示
drawable 中的 circle_add.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<stroke android:width="5dp" android:color="#000000"/>
</shape>
</item>
<item>
<shape android:shape="line">
<stroke android:width="5dp" android:color="#000000" />
</shape>
</item>
<item>
<rotate
android:fromDegrees="90"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="-90">
<shape android:shape="line">
<stroke android:width="5dp" android:color="#000000" />
</shape>
</rotate>
</item>
</layer-list>

我在 editText 中使用了它
<EditText
android:id="@ id/member_email"
android:layout_width="340dp"
android:layout_height="46dp"
android:background="#d4d4d4"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="20dp"
tools:ignore="MissingConstraints"
android:drawableRight="@drawable/circle_add"
tools:layout_editor_absoluteX="36dp"
tools:layout_editor_absoluteY="312dp" />
但它沒有顯示在文本框中。

如何讓它出現在文本框的末尾。
uj5u.com熱心網友回復:
你沒有定義它的大小。
復制以下代碼,然后重試。它將被顯示。
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<size
android:height="10dp"
android:width="10dp" />
</shape>
</item>
<item>
<shape android:shape="oval">
<stroke android:width="1dp" android:color="#000000"/>
</shape>
</item>
<item>
<shape android:shape="line">
<stroke android:width="1dp" android:color="#000000" />
</shape>
</item>
<item>
<rotate
android:fromDegrees="90"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="-90">
<shape android:shape="line">
<stroke android:width="1dp" android:color="#000000" />
</shape>
</rotate>
</item>
</layer-list>
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/537164.html
