我要添加這種類型的下劃線的EditText上如何EditText上的Android
XML
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/InputLayout">
<android.support.v7.widget.AppCompatEditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name" />
</android.support.design.widget.TextInputLayout>
風格
<style name="InputLayout" parent="TextAppearance.AppCompat">
<item name="android:textSize">18sp</item>
<item name="android:textColor">@color/white</item>
<item name="android:textColorHint">@color/grey</item>
<item name="colorAccent">@color/white</item>
<item name="colorControlNormal">@color/white</item>
<item name="colorControlActivated">@color/colorPrimary</item>
<item name="android:background">@drawable/edit_draw</item>
</style>
但是當它添加上攻邊下劃線專注它顯示它自己的下劃線以及可以繪製的背景,並且您可以看到博士awable我使用的也不太好。
你可以改變背景(主色)的顏色,強調... – 2017-08-06 06:05:18
它的工作取代這些繪製但你能告訴我如何畫下劃線和文本之間的差距相同的樣本圖像以及如何改變它的狀態像正常和集中,因爲在目前的狀態,它只攜帶一種顏色在每個國家 – SogekingSenpai
只需添加填充像... android :padding =「5dp」 – 2017-08-06 08:19:27