1

如何在我的应用程序中平滑滚动文本视图?这是一个类似于我的 main.xml 的示例:

<?xml version="1.0" encoding="utf-8"?>
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
    android:id="@+id/textView5"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_marginTop="10dp"
    android:text="ANDROID APPLICATION INFO"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="#FF8000"
    tools:ignore="HardcodedText" />

<RadioButton
    android:id="@+id/radio_english"
    android:layout_width="201dp"
    android:layout_height="55dp"
    android:onClick="onRadioButtonClicked"
    android:text="English"
    tools:ignore="HardcodedText" />

<RadioButton
    android:id="@+id/radio_it"
    android:layout_width="200dp"
    android:layout_height="55dp"
    android:onClick="onRadioButtonClicked"
    android:text="Ita"
    tools:ignore="HardcodedText" />

<TextView
    android:id="@+id/AndroidInfo"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Android Info.:"
    tools:ignore="HardcodedText" />

<TextView
    android:id="@+id/Ainfo"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    tools:ignore="SelectableText"
    android:text="blablablablabla blablablabla blablablablabla blablablabla `blablablablabla blablablabla blablablablabla blablablabla blablablablabla blablablabla" />`

</RadioGroup>

Ainfo textview 是我想要滚动的。但滚动流畅。我尝试了不同的方法,但我尝试的一切都导致滚动不流畅。有什么建议吗?不要考虑功能,因为是一个例子。只是想了解如何使滚动平滑。

4

1 回答 1

5

你想要这样的东西吗?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity$DummySectionFragment" xmlns:app="http://schemas.android.com/apk/res/com.threesixtydgreen">

<ScrollView
    android:id="@+id/horizontalScrollView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:scrollbars="none" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="blablablablabla blablablabla blablablablabla blablablabla `blablablablabla blablablabla blablablablabla blablablabla blablablablabla blablablabla"
            android:textAppearance="?android:attr/textAppearanceLarge" />


</ScrollView>

于 2013-05-28T10:14:27.860 回答