我正在創建一個帶圓角的編輯文本,爲此我使用自定義形狀並將其指定爲編輯文本。我想要: 1-填充編輯文本的區域爲白色。 2-編輯文本的邊界應該是綠色的。 滿足第一個要求但我無法做到第二個要求。這是如何實現的?任何幫助將不勝感激 這裏是我的代碼 編輯文本代碼:如何在android中更改自定義形狀的邊界顏色?
<EditText
android:layout_width="match_parent"
android:layout_height="0dp"
android:hint="E-mailadres"
android:background="@drawable/rounded_layout"
android:layout_marginTop="8dp"
android:layout_weight="2"/>
自定義佈局:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp"
>
<solid android:color="#FFFFFF"/>
<corners
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"
/>
<stroke android:width="1dip" />
</shape>
@AJay用戶需要的角落也。你忘了補充那條線 –