为EditText分配值但显示提示

时间:2014-12-30 06:48:18

标签: java android-layout

我们可以为EditText指定一个值为0,当应用程序启动时,它应该显示提示而不是值,但应该将其分配给该EditText

//XML file 
<EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:id="@+id/amt"
        android:layout_below="@+id/amt_view"
        android:inputType="number"
        android:hint="Whole Amt"
        android:text="0"
        android:padding="10dp" /

0 个答案:

没有答案