如何从右到左滚动 textView?
How to scroll a textView in Right to left direction?
在textview中添加一个大字符串后,如何回滚到字符串的开头部分??
我正在使用以下 textview
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="50sp"
android:singleLine="true"
android:gravity="end"
android:layout_gravity="end"
android:layout_marginTop="40dp">
如何让它从右向左滚动??
试试这个代码。
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/scroll" >
<TextView
android:id="@+id/textViewId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollHorizontally="true"
android:text="your_big_string"/>
</HorizontalScrollView>
在你activity.java里加这个
final HorizontalScrollView scrollView = (HorizontalScrollView) findViewById(R.id.scroll);
scrollView.postDelayed(new Runnable() {
public void run() {
scrollView.fullScroll(HorizontalScrollView.FOCUS_RIGHT);
}
}, 100L);
在textview中添加一个大字符串后,如何回滚到字符串的开头部分?? 我正在使用以下 textview
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="50sp"
android:singleLine="true"
android:gravity="end"
android:layout_gravity="end"
android:layout_marginTop="40dp">
如何让它从右向左滚动??
试试这个代码。
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/scroll" >
<TextView
android:id="@+id/textViewId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollHorizontally="true"
android:text="your_big_string"/>
</HorizontalScrollView>
在你activity.java里加这个
final HorizontalScrollView scrollView = (HorizontalScrollView) findViewById(R.id.scroll);
scrollView.postDelayed(new Runnable() {
public void run() {
scrollView.fullScroll(HorizontalScrollView.FOCUS_RIGHT);
}
}, 100L);