Text box in android

2019-08-30 10:57发布

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.

enter image description here

4条回答
仙女界的扛把子
2楼-- · 2019-08-30 11:39

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!

查看更多
SAY GOODBYE
3楼-- · 2019-08-30 11:40

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.

查看更多
孤傲高冷的网名
4楼-- · 2019-08-30 11:48

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.

查看更多
成全新的幸福
5楼-- · 2019-08-30 12:02

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"/>
查看更多
登录 后发表回答