Android应用程序小部件-如何在两行上创建可调节滚动速度的TextView字幕?

Android应用程序小部件-如何在两行上创建可调节滚动速度的TextView字幕?,android,android-layout,android-widget,horizontal-scrolling,android-appwidget,Android,Android Layout,Android Widget,Horizontal Scrolling,Android Appwidget,我正在尝试创建一个有几个不同行的小部件,并希望将其设置为自动滚动字幕,并能够调整滚动速度。我怎样才能做到这一点 我尝试使用文本视图,并能够使其在一行上滚动,但仅此而已。我似乎无法调整它的速度,或者让两行同时滚动 这方面的一个例子是: 或 有人知道他们是怎么做到的吗?自定义视图 谢谢 这就是我到目前为止所做的: <TextView android:id="@+id/label" android:layout_width="wra

我正在尝试创建一个有几个不同行的小部件,并希望将其设置为自动滚动字幕,并能够调整滚动速度。我怎样才能做到这一点

我尝试使用文本视图,并能够使其在一行上滚动,但仅此而已。我似乎无法调整它的速度,或者让两行同时滚动

这方面的一个例子是:

有人知道他们是怎么做到的吗?自定义视图

谢谢

这就是我到目前为止所做的:

        <TextView
            android:id="@+id/label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@android:color/white"
            android:textStyle="bold"
            android:gravity="center"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="@string/app_name"
            android:singleLine="true" 
            android:ellipsize="marquee"
            android:marqueeRepeatLimit ="marquee_forever"
            android:scrollHorizontally="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:duplicateParentState="true"
            android:layout_weight="1">
            <requestFocus 
                android:focusable="true" 
                android:focusableInTouchMode="true"
                android:duplicateParentState="true" />
        </TextView>

试试这个,我从Java获取文本作为setText文件,并显示在这个屏幕上

<ScrollView
            android:id="@+id/SCROLLER_ID"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_below="@+id/line_dotted"
                android:layout_marginBottom="10dp"
                android:fillViewport="true"
                android:scrollbars="vertical" >

                <TextView
                    android:id="@+id/text_description"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:layout_marginLeft="15sp"
                    android:layout_marginRight="15sp"
                    android:layout_marginTop="10sp"
                    android:scrollbars="vertical"
                    android:textColor="#0A2A1B"
                    android:textSize="12sp" />
            </ScrollView>
或者您可以在不使用scrollview的情况下尝试此操作,当超过5行时,文本将滚动

<EditText
            android:id="@+id/Comments"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_above="@+id/Submitbtn"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/ratingBar"
            android:layout_marginBottom="40dp"
            android:ems="10"
            android:gravity="left"
            android:hint="Comments"
            android:maxLines="5"
            android:padding="20dp"
            android:scrollbarStyle="outsideOverlay"
            android:scrollbars="vertical"
            android:imeOptions="actionDone" />

我以为应用程序小部件中不能有滚动视图?