我想对textview进行选取,但是没有成功地做到这一点。虽然我已经通过一些例子给出了stackoverflow,但仍然有问题。有人可以帮忙吗?
答案 0 :(得分:3)
试试这对我有用
<TextView
android:text="Android Marquee"
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">
</TextView>
答案 1 :(得分:1)
这是创建品牌的最低代码 -
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/MarqueeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="This is a very long text which is not fitting in the screen so it needs to be marqueed."
android:textAppearance="?android:attr/textAppearanceLarge" />
为了让您的品牌更具代表性,请查看: http://yhisham.blogspot.in/2012/08/android-how-to-make-marquee-ticker.html