0

So I'm designing an app that uses google aps api, and I want the map to look better by rounding the corners. I found a bunch of tutorials already but all of them only work if the activity background is a solid color, for example black.

However, my application has a multi-color background. Is there a way to make those corners rounded, but transparent so that it doesn't block my background?

Guy
  • 6,414
  • 19
  • 66
  • 136

2 Answers2

2

Well I guess you have stumbled on this question I asked regarding the same topic:

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

But in this case I needed a solid color corners. I don't see an easy way to perform what you ask for. There is no way to added rounded corners to the map "out of the box" so you will need to cover those corners with some other texture, typically it would be a 9-patch texture, that could stretch accordingly to the screen size.

You can take a look at this blog post on 9-patchs I wrote and maybe try to create a semi-transparent texture that will fit you needs:

9-Patch guide

Community
  • 1
  • 1
Emil Adz
  • 40,709
  • 36
  • 140
  • 187
  • Yes, I already saw your question before asking :) thank you for your answer, I guess it really isn't possible to simply round it with transparent corners. I will just have to either have a square map or I'll just use the semi-transparent texture. – Guy Jul 24 '13 at 14:02
0

I've spent few days trying to figure it out, it also seems like it is not possible to use MapView separately, so this seems to be impossible which really sucks. I've also tried to extend MapView and override onDraw in order to apply it to another class which would extend MapFragment, but it is all seems to be waste of time. Maps layouts really suck in Android...

Iliiaz Akhmedov
  • 867
  • 7
  • 17