【发布时间】:2014-12-23 11:45:58
【问题描述】:
我是 Android 的新开发者。 在哪里可以找到 EditText 的示例? 请在 XML 中。 我试过了,但对我不起作用。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:layout_width="fill_parent"
android:layout_height="2dp"
android:id="@+id/bus"
android:hint="@string/hello_world"
android:singleLine="true"
android:inputType="textCapWords"/>
</LinearLayout>
再见
【问题讨论】:
-
android:layout_height="2dp" 更改为 android:layout_height="wrap_content" 以后请在询问之前阅读一些教程,vogella 或 developer.android 是很好的来源
-
运行代码后得到了什么?
-
这里是一个简单的登录表单示例,通过这个然后开始工作,tutorialspoint.com/android/android_login_screen.htm
标签: android xml android-edittext