第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

怎么TextView Marquee不工作

怎么TextView Marquee不工作

牛魔王的故事 2019-10-20 12:08:12
TextView Marquee不工作我試過使用marquee,它在這里不起作用是我的代碼,請告訴我哪里出錯了。<TextView    android:text="lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00"    android:id="@+id/TextView02"    android:layout_width="200dip"    android:layout_height="wrap_content"    android:marqueeRepeatLimit="marquee_forever"    android:ellipsize="marquee"    android:singleLine="true"    android:focusable="true"    android:inputType="text"    android:maxLines="1"></TextView>我正在使用AndroidSDK2.0.1
查看完整描述

3 回答

?
慕妹3242003

TA貢獻1824條經(jīng)驗 獲得超6個贊

(現(xiàn)工作:)下面所附的代碼

<TextView
    android:text="START | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | 
    Doctor 5000.00 | END"
    android:id="@+id/MarqueeText" 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:singleLine="true"
    android:ellipsize="marquee" 
    android:marqueeRepeatLimit="marquee_forever"
    android:scrollHorizontally="true" 
    android:paddingLeft="15dip" 
    android:paddingRight="15dip" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:freezesText="true">


編輯(代表Adil Hussain):

textView.setSelected(true)需要在后面的代碼中設(shè)置才能工作。



查看完整回答
反對 回復(fù) 2019-10-21
?
慕標(biāo)5832272

TA貢獻1966條經(jīng)驗 獲得超4個贊

android:singleLine="true"
android:ellipsize="marquee"

是唯一需要的屬性,滾動甚至可以使用layout_weightlayout_width=0dp

下面是一些示例代碼:

<TextView 
            android:id="@+id/scroller"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#FFFFFF"
            android:text="Some veryyyyy long text with all the characters that cannot fit in screen, it so sad :
            ( that I will not scroll"
            android:layout_marginLeft="4dp"
            android:layout_weight="3"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            />

但最重要的是含蓄或解釋TextView 應(yīng)該被選中.

你可以這樣做:

TextView txtView=(TextView) findViewById(R.id.scroller);txtView.setSelected(true);



查看完整回答
反對 回復(fù) 2019-10-21
?
慕妹3146593

TA貢獻1820條經(jīng)驗 獲得超9個贊

這些屬性必須包含在textview標(biāo)簽以允許滾動。

其他一切都是可選的。

android:focusable="true"android:focusableInTouchMode="true"android:layout_width="fill_parent"android:ellipsize="marquee"


查看完整回答
反對 回復(fù) 2019-10-21
  • 3 回答
  • 0 關(guān)注
  • 297 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號