android中的文本框

时间:2015-10-15 02:34:59

标签: android android-studio textbox

我想知道在text box的左侧面板中我可以从哪里获得android studio(如下图所示)?我可以看到,只有textFields在文本下面有一行而不是文本框。

enter image description here

5 个答案:

答案 0 :(得分:4)

它被称为EditText。我相信在Android Studio中它是TextField,下面有一行。只是使用不同的主题。要获得TextBox外观,您需要使用其中一个旧主题,例如`@android:style / Theme.Light。

答案 1 :(得分:0)

Android中没有此类对象“TextBox”。

您看到的是应用标题栏中应用的名称。

它由系统提供。

答案 2 :(得分:0)

正如其他人所说的那样,它是旧版API的系统默认主题,但它并没有被广泛使用,其设计有点过时。我强烈建议将EditText包装在一个drawable中,因为它可以让你控制设计,并使它更具视觉刺激性=)好的一面是它非常简单地创建一个形状可以在xml中绘制!

答案 3 :(得分:0)

您必须使用EditText在android studio中创建此类文本框,示例如下所示

<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"/>

答案 4 :(得分:0)

您可以在面板的“文本”部分中找到该文本框。单击“纯文本”标签,然后将其拖到您的设计器中。

enter image description here

如果单击下面的按钮,您将看到xml代码。该文本框称为EditText。

enter image description here