我想在InfoWindow中顯示長文本,我認爲如果文本自動滾動會很好。我已經嘗試使用字幕,但文本不滾動。任何想法我做錯了什麼?Android Google Maps InfoWindow自動滾動顯示的文本
這裏是我的佈局代碼:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/title"
android:layout_width="@dimen/infoWindowMaxWidth"
android:layout_height="wrap_content"
android:textStyle="bold"
android:lines="1"
android:layout_centerInParent="true"
android:textColor="@android:color/white"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true" />
</RelativeLayout>
我InfoWindowAdapter:
class CustomInfoWindowAdapter : Java.Lang.Object, GoogleMap.IInfoWindowAdapter
{
.
.
.
private void Render(Marker marker, View view)
{
var textView = view.FindViewById<TextView>(Resource.Id.title);
textView.Text = marker.Title;
textView.Selected = true;
}
}
marques不適合滾動..當文本匹配textview的寬度時,Marque的作品 –
@TerrilThomas http://stackoverflow.com/questions/5472362/android-automatic-horizontally-scrolling- textview – Roosevelt
你的文字是否填滿了全文視圖? –