【发布时间】:2015-11-30 10:43:00
【问题描述】:
我一直在尝试在通知库CROUTON中实现android上文本的标记效果。我的功能下。
public void onCustomNotice(View v) {
View customView = getLayoutInflater().inflate(R.layout.custom_crouton_layout, null);
Crouton.show(this, customView);
}
我的自定义布局如下。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#c9dfff"
android:layout_gravity="center"
android:orientation="vertical"
android:paddingTop="15dp"
android:paddingBottom="15dp"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" >
<TextView
android:id="@+id/scroller"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:singleLine="true"
android:marqueeRepeatLimit="marquee_forever"
android:maxLines="1"
android:text="Some veryyyyy long text with all the characters that cannot fit in screen, it so sad :( that I will not scroll"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
</LinearLayout>
通常的 textview 可以作为 marque 使用,但在 crouton 内部却不行。请提出一些解决方案。先感谢您。 :)
我参考了this 链接,但我没有得到预期的答案。
【问题讨论】:
标签: text scroll marquee crouton-os