Is there a way to implement rounded corners to a Mapfragment?

后端 未结 7 699
忘了有多久
忘了有多久 2020-11-30 09:10

I want to give the map a nice looking rounded corners as the two boxes below it have. I can\'t do it with the map fragment it self because there is not a background property

7条回答
  •  攒了一身酷
    2020-11-30 10:07

    I haven't tried this, but I'd put a view with rounded corners and a transparent middle on top of the mapView / mapFragment.

    That is, put the mapFragment and the rounded corner view in a FrameLayout with both filling the FrameLayout, then make the middle of the rounded corner view transparent.

    For further clarification, you could do it in a layout as follows:-

    
    
    
    
    
    
    
    
    
    

    The rounded_background is a 9-patch with rounded corners and a transparent middle. E.g.

    rounded_background.9.png

    Hope that helps,

    Ryan

提交回复
热议问题