0

I'm using Mapbox SDK and SMCalloutView

callout.view.frame = CGRectMake(0, 0, 300, 115);
SMCalloutView *smcallout = [[SMCalloutView alloc] init];
smcallout.contentView = callout.view;
[smcallout presentCalloutFromRect:smcallout.frame inLayer:annotation.layer constrainedToLayer:map.layer animated:YES];

How can i change margins from contentView to borders of calloutView?

enter image description here

jazzurro
  • 23,179
  • 35
  • 66
  • 76

2 Answers2

2

You can change the UIEdgeInsets of contentView.

[calloutView setContentViewInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)];
Rags93
  • 1,424
  • 1
  • 14
  • 14
  • mmm... i tried to do that, but.. .how, because I have a var `SMCalloutView *currentCallout` but I tried to do `[currentCallout setContentViewInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)];` or `[currentCallout.contentView setContentViewInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)];` but doesn't work... what is wrong? – bubudrc Oct 21 '15 at 19:00
0

You have to overwrite the SMCalloutView as I did here:

https://github.com/Olinguito/YoIntervengoiOS/blob/master/Pods/SMCalloutView/SMCalloutView.m#L18

Hope it helps you.

lojals
  • 981
  • 10
  • 19