Marquee Text Android Not Working -
here layout , dont know why not working search answer still cannot run , test add scroll still cannot
here code
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical"> <android.support.v7.widget.cardview xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginbottom="5px" android:layout_marginleft="5px" android:layout_marginright="5px" card_view:cardcornerradius="4dp"> <tablerow android:id="@+id/layout_b" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1"> <imageview android:layout_width="wrap_content" android:layout_height="80px" android:src="@drawable/home" android:layout_gravity="left" android:layout_toleftof="@+id/info_text" /> <textview android:id="@+id/info_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusableintouchmode="true" android:ellipsize="marquee" android:marqueerepeatlimit="marquee_forever" android:scrollhorizontally="true" android:singleline="true" /> </tablerow> </android.support.v7.widget.cardview> </linearlayout> whats wrong code ? pls
solution 1
change wrap_content value match_parent or fixed width.
<textview android:id="@+id/info_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:focusableintouchmode="true" android:ellipsize="marquee" android:marqueerepeatlimit="marquee_forever" android:scrollhorizontally="true" android:singleline="true" /> or
<textview android:id="@+id/info_text" android:layout_width="100dp" android:layout_height="wrap_content" android:focusableintouchmode="true" android:ellipsize="marquee" android:marqueerepeatlimit="marquee_forever" android:scrollhorizontally="true" android:singleline="true" /> solution 2
try use below code after view rendered.
textview.setselected(true);
Comments
Post a Comment