我在頁腳中有文本視圖,我想在頁腳中滾動該文本。這是我的代碼片段,但文本不會滾動。任何機構可以幫助我 由於提前 我的代碼如何在android中獲取自動滾動文本視圖
public class Footer extends RelativeLayout{
private TextView footer_TextVeiw;
ImageView logout;
public Footer(Context context, AttributeSet attrs) {
super(context, attrs);
String infService = Context.LAYOUT_INFLATER_SERVICE;
LayoutInflater li = (LayoutInflater) getContext().getSystemService(infService);
li.inflate(R.layout.footer_layout, this, true);
footer_TextVeiw= (TextView) this.findViewById(R.id.text_Footer);
footer_TextVeiw.setSelected(true); } }
我的XML佈局
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Footer" >
<TextView
android:id="@+id/text_Footer"
android:layout_width="fill_parent"
android:layout_height="25dp"
android:layout_alignParentBottom="true"
android:background="#ECEFF5"
android:layout_centerHorizontal="true"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:scrollHorizontally="true"
android:ellipsize="marquee"
android:text="@string/Footer"
/>
</RelativeLayout>
可能重複:http://stackoverflow.com/questions/11184054/android-auto-scrolling-text-in-textview – EvZ 2013-02-20 09:31:35