2013-11-29 5 views
0

Каждый знает, как удалить края обычая InfoWindowПроблема с пользовательскими InfoWindow в Google Maps V2 для Android

enter image description here

Это мой XML из InfoWindow

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/negro" 
    android:orientation="horizontal" > 

    <ImageView 
     android:id="@+id/image_mapa" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_marginRight="10dp" 
     android:adjustViewBounds="true" 
     android:src="@drawable/ic_launcher" /> 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" > 

     <TextView 
      android:id="@+id/title" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Las Flores" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:textColor="@color/blanco" 
      android:textStyle="bold" /> 

     <TextView 
      android:id="@+id/snippet" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Resto bar" 
      android:textColor="@color/blanco" /> 

     <TextView 
      android:id="@+id/descuento" 
      android:layout_width="100dp" 
      android:layout_height="wrap_content" 
      android:text="20% OFF" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:textColor="@color/verde_habitues" 
      android:textStyle="bold" /> 

    </LinearLayout> 

</LinearLayout> 

Я используя адаптор, который реализует InfoWindowAdapter

Спасибо!

+0

Там нет обивки о Марже в любом месте – benoffi7

+0

возможного дубликата [Как поставить вытяжку, как фон в InfoWindow (Google Maps API v2 для Android)?] (http://stackoverflow.com/questions/16518338/how-to-put-drawable-as-a-background-on-infowindow-google-maps-api -v2-for-androi) –

ответ

6

Решения на адаптере я nstead перезаписывать getInfoContents перезаписать getInfoWindow

public class MyInfoWindowAdapter implements InfoWindowAdapter 
{ 
    private final View myContentsView; 
    private Context ctx; 

    public MyInfoWindowAdapter(View myContentsView, Context ctx) 
    { 
     this.myContentsView = myContentsView; 
     this.ctx = ctx; 
    } 

    @Override 
    public View getInfoContents(Marker marker) 
    { 
     return null; 
    } 

    @Override 
    public View getInfoWindow(Marker marker) 
    { 


    TextView tvTitle = ((TextView)myContentsView.findViewById(R.id.title)); 
     tvTitle.setText(marker.getTitle());   


     return myContentsView; 

    } 

} 

enter image description here

+0

привет у меня такой же проблема, так как в вашем ответе он показывает информационное окно, но он не показывает стрелку от маркера ... Пожалуйста, дайте мне знать причину. – MPG

+0

это обязательно решает проблему, но также делает по умолчанию «речевой пузырь» исчезает. Есть ли способ удалить прокладку, которая появляется, показывая «название» в «пузыре речи»? –

Смежные вопросы