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:

http://i.stack.imgur.com/ljhp1.jpg

i merge map make smaller , avoid it.

edit: @ryan new result #2:

http://i.stack.imgur.com/69d59.jpg

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:

http://i.stack.imgur.com/1qx66.png

well have figured out:

http://i.stack.imgur.com/by4n5.jpg

this used patch:

enter image description here

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.

rounded_background.9.png

hope helps,

ryan


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -