2017-12-18 16 views
0

私は自分のアクティビティのレイアウトに以下のtextViewを持っています。それは自動的に水平にスクロールしますが、それは起こりません。誰がここになぜこれが起こるのか知っていますか? TextViewの横スクロールを行うことがスクロールしているテキストが機能しない

<TextView 
    android:id="@+id/superAttackDesc" 
    android:layout_width="314dp" 
    android:layout_height="21dp" 
    android:layout_marginBottom="5dp" 
    android:layout_marginStart="8dp" 
    android:ellipsize="marquee" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:fontFamily="monospace" 
    android:marqueeRepeatLimit="marquee_forever" 
    android:scrollHorizontally="true" 
    android:singleLine="true" 
    android:textAlignment="viewStart" 
    android:textColor="@android:color/white" 
    android:textStyle="italic" 
    app:layout_constraintBottom_toBottomOf="@+id/cardDetailsImageView" 
    app:layout_constraintEnd_toEndOf="parent" 
    app:layout_constraintHorizontal_bias="0.753" 
    app:layout_constraintStart_toStartOf="parent" 
    app:layout_constraintTop_toBottomOf="@+id/superAttackTitle" 
    app:layout_constraintVertical_bias="0.175" /> 
+2

テキストが代わりに新しい行を追加するのでは広すぎるときに**水平自動的にスクロール** –

+0

@AmitVaghela最も可能性の高いスクロールによって何を意味していますか? – Zoe

答えて

0

1)のTextViewが親アクティビティののonCreateで選択されていることを確認してくださいandroid:singleLine =真android:ellipsize = "マーキー"

2)を設定します。

findViewById(R.id.SAMPLE).setSelected(true); 

コードの参照:

<TextView 
android:id="@+id/SAMPLE" 
android:layout_width="..." 
android:layout_height="..." 
android:ellipsize="marquee" 
android:marqueeRepeatLimit="marquee_forever" 
android:singleLine="true" 
android:text="@string/SAMPLE"/> 
関連する問題