问题
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?
回答1:
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.
回答2:
You can change the UIEdgeInsets of contentView.
[calloutView setContentViewInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)];
来源:https://stackoverflow.com/questions/27341610/how-to-change-margins-in-smcalloutview