Text box in android

只愿长相守 提交于 2020-01-25 21:04:21

问题


I wonder where can I get the text box(as shown in diagram below) at the left panel of android studio? As I can see, there only has textFields which has a line below the text but not text box.


回答1:


It's called EditText. I believe in Android Studio it is the TextField which has a line below. Just using a different theme. To get the TextBox look you need to use one of the old themes like `@android:style/Theme.Light for your application.




回答2:


There is no such object "TextBox" in Android.

What you are seeing is the name of the app in the app's title bar.

It's supplied by the system.




回答3:


as others had suggested it's a system-default theme from an older API, however it isn't used much and its design is a bit out-dated. i'd highly suggest wrapping a EditText in a drawable, since it'd give you control of the design, and make it more visually stimulating =) the plus side is it's very simply to create a shape drawable in xml!




回答4:


you have to use the EditText to create such textbox in android studio, example is displayed below

<EditText
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:hint="type your name here"
          android:id="@+id/edit_text"
          android:layout_marginTop="10dp"
          android:inputType="textPersonName|textCapWords"/>


来源:https://stackoverflow.com/questions/33138862/text-box-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!