0

我正在使用 Mapbox SDK 和 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];

如何将 contentView 的边距更改为 calloutView 的边框?

在此处输入图像描述

4

2 回答 2

2

您可以更改 contentView 的 UIEdgeInsets。

[calloutView setContentViewInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)];
于 2015-04-22T12:56:10.567 回答
0

您必须像我在这里所做的那样覆盖 SMCalloutView:

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

希望它可以帮助你。

于 2015-01-25T17:58:26.500 回答