簡體   English   中英

字幕文本在三星Galaxy S3中無法正常工作

[英]Marquee text is no working properly in samsung Galaxy S3

我已經完成了字幕文本。 我是通過以下代碼片段實現的

    <TextView
        android:id="@+id/scrolltext"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#000"
        android:ellipsize="marquee"
        android:marqueeRepeatLimit="marquee_forever"
        android:padding="5dip"
        android:scrollHorizontally="true"
        android:singleLine="true"
        android:text="@string/scrolltext"
        android:textColor="#F4CE6B" />

問題是它在某些手機(例如三星Galaxy s3)中無法正常工作。 不顯示全文。 代替的是,那里只有少數的溺愛者。

解決了這個問題。

我通過調用其他滾動移動方法在編碼中犯了一個錯誤。

scroll_text.setText(scroll); 
scroll_text.setSelected(true);
scroll_text.setMovementMethod(new ScrollingMovementMethod());

現在,刪除該行代碼似乎可以。

scroll_text. set Selected(true);
scroll_text.setText(scroll);
<TextView
        android:id="@+id/scrolltext"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ellipsize="marquee"
        android:fadingEdge="horizontal"
        android:marqueeRepeatLimit="marquee_forever"
        android:scrollHorizontally="true"
        android:singleLine="true"
        android:text="Simple application that shows how to use marquee, with a long text"
        android:textColor="#F4CE6B" />

這對我有用。也在活動的onCreate()中給出

TextView textView =(TextView)findViewById(R.id.scrolltext); textView.setSelected(真);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM