【问题标题】:How can I scroll all textviews in android widget?如何滚动 android 小部件中的所有文本视图?
【发布时间】:2015-07-16 15:29:49
【问题描述】:

我用两个 textviews 制作了小部件,只有一个 TextView 在滚动...我该怎么做

滚动所有文本视图

我使用另一个问题的这个解决方案,但它只适用于一个TextView..

链接:Is it possible for TextView Marquee in a Widget that extends AppWidgetProvider?

 <TextView android:id="@+id/fact" android:layout_width="200dp"
            android:text="Loading... More text to see if it spans or not and want more"
            android:singleLine="true" 
            android:ellipsize="marquee"
            android:marqueeRepeatLimit ="marquee_forever"
            android:scrollHorizontally="true"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:duplicateParentState="true">
        <requestFocus android:focusable="true" android:focusableInTouchMode="true"
            android:duplicateParentState="true" />
    </TextView>

如何滚动所有文本视图?谢谢

【问题讨论】:

    标签: java android xml widget


    【解决方案1】:

    在滚动视图中滚动所有内容

    manifest.xml

    <application>    
    <activity
                android:name=".ui.activity.ApsessionMainActivity"
                android:screenOrientation="portrait"
                android:configChanges="orientation|screenSize"
                android:windowSoftInputMode="adjustResize">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    </application>
    

    activity.xml

        <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            android:isScrollContainer="true"
            tools:context=".ui.activity.ApsessionMainActivity">
    
        // All other tag
    
    
        </ScrollView >
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-16
      • 1970-01-01
      • 1970-01-01
      • 2014-04-20
      • 1970-01-01
      相关资源
      最近更新 更多