Android Google地图InfoWindow会自动滚动显示文字

时间:2013-11-15 11:32:21

标签: android google-maps textview xamarin.android google-maps-markers

我想在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;
        }
    }

1 个答案:

答案 0 :(得分:2)

问题是信息窗口不是实时视图,所以你将无法做你想做的事情