How to change margins in SMCalloutView

风格不统一 提交于 2019-12-08 12:08:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!