0

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

marques不適合滾動..當文本匹配textview的寬度時,Marque的作品 –

+0

@TerrilThomas http://stackoverflow.com/questions/5472362/android-automatic-horizo​​ntally-scrolling- textview – Roosevelt

+0

你的文字是否填滿了全文視圖? –

回答

2

的問題是信息窗口是不是一個實時取景,所以你將不能夠做你想做什麼做

+0

任何解決方法? – Roosevelt

+0

不容易http://stackoverflow.com/questions/14123243/google-maps-api-v2-custom-infowindow-like-in-original-android-google-maps/15040761#15040761 – tyczj

+0

@Roosevelt提供的鏈接tyczj doesn解決動畫問題。這實際上是「更容易」,如果你修改它的信息窗口定期刷新一些負邊緣。 –

相關問題