How can I marquee the text content in Notification?

前端 未结 3 828
我在风中等你
我在风中等你 2021-01-05 13:05

The text content is just too long to be displayed in the notification and it is cut. What can I do? Please help.

相关标签:
3条回答
  • 2021-01-05 13:40

    Try this:

    it Works for me, I have tested it.

    First Create the Custom Notification :

    as Shown here: This Link of the developer site.

    After that in TextView of message you want to marquee, put this line:

     android:ellipsize="marquee"
    

    And It Works as you want. Enjoy. Hope it will help you. Thanks.

    0 讨论(0)
  • 2021-01-05 13:41

    Set up a Custom Layout for the Notification. In the Layout, use a TextView for the Notification, then on the XML for the TextView, add in:

    android:ellipsize="marquee"
    
    0 讨论(0)
  • 2021-01-05 13:55
                        <TextView
                        android:id="@+id/place"
                        android:layout_toRightOf="@+id/line1"
                        android:clickable="true"
                        android:ellipsize="marquee"
                        android:fadingEdge="horizontal"
                        android:gravity="bottom"
                        android:lines="1"
                        android:marqueeRepeatLimit="marquee_forever"
                        android:paddingLeft="4dip"
                        android:scrollHorizontally="true"                        
                        android:textColor="#00BFFF"
                        android:textSize="18dip" />
    

    Delete any useless line and change the id according to ur code.

    0 讨论(0)
提交回复
热议问题