天道酬勤,学无止境

smcalloutview

如何在 SMCalloutView 中更改边距(How to change margins in SMCalloutView)

问题 我正在使用 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 的边框? 回答1 您必须像我在这里所做的那样覆盖 SMCalloutView: https://github.com/Olinguito/YoIntervengoiOS/blob/master/Pods/SMCalloutView/SMCalloutView.m#L18 希望对你有帮助。 回答2 您可以更改 contentView 的 UIEdgeInsets。 [calloutView setContentViewInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)];

2021-09-16 06:20:45    分类:技术分享    objective-c   mapbox   smcalloutview

How to change margins in SMCalloutView

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?

2021-07-09 21:17:07    分类:问答    objective-c   mapbox   smcalloutview