2017-05-05 57 views
-1

我有以下佈局:GoogleMap的移動,Xamarin

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/root" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <fragment 
    android:id="@+id/fragment_map" 
    class="com.google.android.gms.maps.SupportMapFragment" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 
    <LinearLayout 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true"> 
    <RelativeLayout 
     android:id="@+id/rel_layout_location" 
     android:layout_gravity="right" 
     android:layout_margin="10dp" 
     android:background="@drawable/white_circular_shadow" 
     android:layout_width="60dp" 
     android:layout_height="60dp"> 
     <ImageView 
     android:background="@drawable/location" 
     android:adjustViewBounds="true" 
     android:layout_centerInParent="true" 
     android:layout_width="20dp" 
     android:layout_height="20dp" /> 
    </RelativeLayout> 
    <RelativeLayout 
     android:id="@+id/info_window_container" 
     android:background="@color/white" 
     android:visibility="gone" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" > 
     <TextView 
     android:padding="10dp" 
     android:id="@+id/textview_title" 
     android:text="How you doing" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 
    </RelativeLayout> 
    </LinearLayout> 
</RelativeLayout> 

我有機會獲得的RelativeLayout:

relativelayout_info_container = FindViewById<RelativeLayout>(Resource.Id.info_window_container); 

一切工作正常,但是當我嘗試隱藏相對佈局地圖發瘋(這是MarkerClick內):

googleMap.MarkerClick += MarkerClick; 

然後裏面MarkerCli放:

relativelayout_info_container.Visibility = ViewStates.Gone; 

它取消動畫,它取消抽頭標記功能,移動映射到第一位置,並放大顯示了像已經復位。

任何想法?如果您需要了解更多信息,請讓我知道在評論

UPDATE:

我只是增加了一個調用設置填充到地圖,因此不會掩蓋GoogleMap的標誌,同樣的問題出現:

googleMap.SetPadding(0, 0, 0, <some_value>); 

地圖填充的變化正在影響着變化我做的標記內MarkerClick

回答

0

完全不相干的問題圖標和相機的更新。這個問題真的出現在我的代碼的另一部分。我有一個ViewTreeObserver,這是動畫地圖。一旦我取消訂閱它,一切正常;)