Create a custom info window in google maps V2

后端 未结 3 940
旧时难觅i
旧时难觅i 2021-02-07 01:47

I\'m trying to make a custom window that look like that (for map objects).

\"User

But instead of

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-07 02:26

    If you want to customize the InfoWindow:

    1. Make a custom InfoWindowAdapter (make sure to send the context) by overriding the the required methods.

    2. Inflate the custom view.

    3. Refer all the views by findViewById() and do that every needed.

    4. Set the Adapter Like this :

    mMap = googleMap; mMap.setInfoWindowAdapter(new CustomInfoWindowAdapter getApplicationContext()));

提交回复
热议问题