2016-10-28 6 views
-1

enter image description here私のアプリケーションページにはイメージビューとテキストビューがあります。私はテキストビューにテキストを設定しようとしているとき、それは複数行になりますが、テキスト全体を1行にしたいのです。どうやってやるの?私は、90度の角度でそのテキストビューを望む アンドロイドテキストビューでシングルラインを取得する方法

<ImageView 
    android:layout_height="match_parent" 
    android:id="@+id/frames" 
    android:layout_width="280dp" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentStart="true" /> 

<FrameLayout 
    android:layout_height="match_parent" 
    android:layout_width="80dp" 
    android:layout_alignParentEnd="true"> 

    <TextView 
     android:text="TextViewhsfsjchsbcdbbbbbbbbbbbbbbbbbbbbbbbbbbbb" 

     android:layout_width="wrap_content" 
     android:textAlignment="center" 
     android:layout_alignParentBottom="false" 
     android:rotation="-90" 
     android:id="@+id/textforscenes" 
     android:layout_marginLeft="15dp" 
     android:gravity="center" 
     android:layout_height="match_parent" /> 
</FrameLayout> 

+0

Googleのキーワード:アンドロイドシングルライン。次回は**尋ねる前に**検索してください。 –

答えて

0

てみアンドロイド:MAXLINES = "1" またはアンドロイド:単一行= "true" を

+0

は機能していません –

1

単一行がdeprecatedです。代わりにmaxLinesを使用してください。

<TextView 
    android:maxLines="1" 
    android:text="TextViewhsfsjchsbcdbbbbbbbbbbbbbbbbbbbbbbbbbbbb" 
    android:layout_width="wrap_content" 
    android:textAlignment="center" 
    android:layout_alignParentBottom="false" 
    android:rotation="-90" 
    android:id="@+id/textforscenes" 
    android:layout_marginLeft="15dp" 
    android:gravity="center" 
    android:layout_height="match_parent" /> 
+0

最初の8文字を表示しています –

関連する問題