摘要:Android - EditText 多行輸入 及,EditText Border製作
EditText 要能夠有Enter鍵,則需設定inputType = textMultiLine
若太長,則需要scroll時,則需設定scroolbars
<EditText
android:id="@+id/edit_desc"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_weight="1"
android:singleLine="false"
android:hint="@string/input_desc"
android:inputType="textMultiLine"
android:scrollbars="vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
android:background="@drawable/edit_bg"/>
若框線想要為某個顏色時,則需要自己做一個xml,設他為背景。
edit_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#00000000" />
<stroke android:width="3dp" android:color="#60A7CD" />
</shape>
參考網址:
http://www.cnblogs.com/haochuang/p/3571754.html
http://www.devdiv.com/forum.php?mod=viewthread&tid=85314