Google map for android my location custom button

前端 未结 4 1465
不知归路
不知归路 2020-12-01 00:53

How can I change google map my location default button? I set my location enable and map draw standard image to find location, is it possible to change default image?

4条回答
  •  时光说笑
    2020-12-01 01:44

    This might be useful to someone who is looking for changing the location icon directly, instead of using any trick or workaround:

    locationButton = (mapView.findViewById(Integer.parseInt("1")).parent as View)
        .findViewById(Integer.parseInt("2"))
    
    locationButton.setImageResource(R.drawable.ic_location_current)`
    

    Here findViewById is the right thing to be done.

提交回复
热议问题