2016-12-03 38 views
-2

enter image description here開始從第一下一行的文本視圖

我在每行兩個文本視圖,我想下一行,從佈局開始啓動,但它在文本視圖放置啓動。有沒有文字視圖的任何屬性來實現這一目標?

<RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_marginTop="5dp" 
      android:id="@+id/relative_english" 
      android:layout_height="wrap_content"> 


      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textAppearance="?android:attr/textAppearanceMedium" 
       android:text="MainTranslation:" 
       android:textColor="@android:color/holo_green_light" 
       android:id="@+id/english_lable_offer" 
       android:layout_alignParentStart="true" 
       android:layout_alignParentLeft="true" 
       /> 

      <TextView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:textAppearance="?android:attr/textAppearanceMedium" 
       android:text="saf" 
       android:id="@+id/tv_english_show_offer" 
       android:layout_centerVertical="true" 
       android:layout_toRightOf="@+id/english_lable_offer" 
       android:layout_toEndOf="@+id/english_lable_offer" /> 


     </RelativeLayout> 

這是我的文本視圖代碼。

回答

1

這是不可能的。但是,如果您想實現這一目標,則必須只將一個TextView放入一行,然後合併您所擁有的字符串。

+0

但theier字體是指出錯誤,我不希望使用Spannable。 –

+0

爲什麼你不想使用Spannable? – Berkay92

0

這就是你必須做的事情.... 變化相對於線性和設置機器人:方向=「垂直」

<LinearLayout 
android:padding="5dp" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_marginTop="5dp" 
android:id="@+id/relative_english" 
android:layout_height="wrap_content" 
xmlns:android="http://schemas.android.com/apk/res/android"> 
+0

但這樣第二個文本視圖在第一個文本視圖下。我需要做的是其餘的文本站在第一個文本視圖下 –

相關問題