TextViewSwitcher で上下にスクロールできません。textviewswitcher の個々のテキスト ビューにスクロールを追加すると、ビュー間の切り替えが機能しません。
ユーザーが textswitcher を使用して上下にスクロールできるようにする方法はありますか、または水平スワイプとテキストの上下スクロールを可能にする代替 UI コンポーネントはありますか?
前もって感謝します
今日も同じことをしようとしていて、ネットで答えを探していました。これは2013年の投稿ですが、将来誰かがこれが役立つことを期待して、まだ答えています。
TextSwitcher does not scroll even if I specify
- scroll properties in xml layout or
- set TextView's setVerticalScrollBarEnabled(true) in program
- set TextSwitcher's setVerticalScrollBarEnabled(true) in program
TextSwitcher は ScrollView コンテナ内でのみスクロールします
ScrollView の子は、スクロール ディメンションの layout_width または layout_height を wrap_content に設定する必要があります。match_parent または fill_parent ではありません。
<LinearLayout
.......
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_gravity="end" >
<TextSwitcher
android:id="@+id/id_text_help_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp" />
</ScrollView>
.........
</LinearLayout>