应用程序中的文本格式。

时间:2013-06-05 17:48:07

标签: android text formatting edit

非常简单的问题。 或者我是一个白痴。 基本上我在.xml中创建了一个带有文本的应用程序(在列表中):

-name
-email
-phone
-venue
-date
-etc

而不是在应用程序中它出来像这样

  

姓名地址电话县等

它只是我还是这个简单的香港专业教育学院看起来和搜索谷歌但我找不到任何与我的情况相关的东西

  • 如果我做错了,我该怎么用?
    • 我是否需要创建另一个textview eveytime我有一条新线?

非常感谢

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".Main" >

<TextView
    android:id="@+id/textView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:text=""
    android:textAppearance="?android:attr/textAppearanceSmall" />

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true" >
</LinearLayout>

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:orientation="vertical"
    android:text="Name *
Phone *

Email *

Type of Event

Date of Event (if known)

What would you like to know more about?

Message:
"
        android:textAppearance="?android:attr/textAppearanceSmall" />

</RelativeLayout>

1 个答案:

答案 0 :(得分:0)

将TextView更改为:

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:orientation="vertical"
    android:text="Name *\n
    Phone *\n
    Email *\n
    Type of Event\n
    Date of Event (if known)\n
    What would you like to know more about?\n
    Message:"
    android:textAppearance="?android:attr/textAppearanceSmall" />

\nnewline个字符。如果你想要换行,请使用它。