내 응용 프로그램의 텍스트보기에 마키 기능을 적용하고 성공적으로 구현했습니다. 다음은 내가 사용한 코드입니다. 내가 텍스트 뷰는 다음 천막 기능이 작동하지 않는 작은 텍스트를 할당하는 경우 작은 텍스트를 사용하여 안드로이드의 TextView에 marqee를 추가하는 방법
<TextView android:id="@+id/latest_notification" android:layout_width="fill_parent" android:layout_height="20dp" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:freezesText="true" android:marqueeRepeatLimit="marquee_forever" android:paddingLeft="15dip" android:paddingRight="15dip" android:scrollHorizontally="true" android:singleLine="true" />
및
mLatestNotification = (TextView) view
.findViewById(R.id.latest_notification);
mLatestNotification.setSelected(true);
mLatestNotification
.setText("Scrollable textScrollable textScrollable textScrollable textScrollable text Scrollable text");
조각
에서 이제 내 질문입니다. 작은 텍스트에도 차양을 적용 할 수있는 방법이 있습니까? 텍스트 크기가 큰 경우<TextView
android:id="@+id/text"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:text="TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView"
android:textAppearance="?android:attr/textAppearanceSmall" />
그것은에서만 작동, 당신은
큰 텍스트를 줄 때만 작동합니다. 작은 텍스트를 위해 그것을 할 수있는 방법이 있습니까? – Ramesh