android - Is there a way to implement rounded corners to a Mapfragment? -
i want give map nice looking rounded corners 2 boxes below have. can't map fragment self because there not background property fragment. setting map inside layout , setting background rounded shape didn't me , result:
i merge map make smaller , avoid it.
edit: @ryan new result #2:
i guess not bad, no close corners on other boxes, still not bad little more work somewhere close dont have normal image editor. 1 thing still bothers me separation between "location" textview , map it's self. painted patch in other way there distance? how did it:
well have figured out:
this used patch:
thanks.
i haven't tried this, i'd put view rounded corners , transparent middle on top of mapview / mapfragment.
that is, put mapfragment , rounded corner view in framelayout both filling framelayout, make middle of rounded corner view transparent.
for further clarification, in layout follows:-
<?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <fragment xmlns:map="http://schemas.android.com/apk/res-auto" android:id="@+id/mapfragment" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.mapfragment" /> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/rounded_background" android:orientation="vertical" > </linearlayout> </framelayout>
the rounded_background 9-patch rounded corners , transparent middle. e.g.
hope helps,
ryan
Comments
Post a Comment