Custom infowindow with google maps api v2

后端 未结 4 1098
青春惊慌失措
青春惊慌失措 2020-12-10 15:04

I can customize the content of the infoWindow with a simple block of code:

 private GoogleMap mMap;
 mMap.setInfoWindowAdapter(new InfoWindowAdapter() {

            


        
4条回答
  •  北海茫月
    2020-12-10 15:32

    Try this...I have change little bit of your code.

    
    
    
       
    
        
    
        
    
    
    

    Also change this...

     mMap.setInfoWindowAdapter(new InfoWindowAdapter() {
    
            public View getInfoWindow(Marker arg0) {
                View v = getLayoutInflater().inflate(R.layout.custom_infowindow, null);
                return v;
            }
    
            public View getInfoContents(Marker arg0) {
    
                //View v = getLayoutInflater().inflate(R.layout.custom_infowindow, null);
    
                return null;
    
            }
        });
    

    I hope it will work...:)

提交回复
热议问题