我正在將文本滾動爲here。在Android中滾動textview不滾動。
我想我看到它是第一次在另一個佈局中滾動,即使沒有任何Java代碼。 但現在,它不再滾動了。不知道這有什麼問題。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="?attr/actionBarSize">
<LinearLayout
android:id="@+id/scrollingTextLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#0792B5"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/scrollingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:maxLines="1"
android:padding="5dp"
android:scrollHorizontally="true"
android:text="The culture of India is the way of living of people of India."
android:textColor="#FFFFFF"
android:textSize="16sp" />
</LinearLayout>
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/scrollingTextLayout"
android:background="@android:color/darker_gray" />
</RelativeLayout>
設置佈局寬度android:layout_width =「wrap_content」,然後嘗試 – Pavya
完成。一樣。仍然不滾動。 –
嘗試在代碼中使用'textView.setSelected(true)'。來源:[鏈接](http://stackoverflow.com/a/3333855/5373110) – Meet