2014-12-07 51 views
0

我使用Mapbox SDK和SMCalloutView如何更改页边距在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]; 

我怎样才能改变利润从内容查看到calloutView的边界?

enter image description here

+0

您是否可以使用Mapbox和SMCalloutView构建项目? – Rajesh 2015-12-22 09:58:04

回答

2

您可以更改contentView的UIEdgeInsets。

[calloutView setContentViewInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)]; 
+0

mmm ...我试图做到这一点,但.. ..因为我有一个var'SMCalloutView * currentCallout',但我试图做'[currentCallout setContentViewInset:UIEdgeInsetsMake(0.0f,0.0f,0.0f,0.0f )];'或'[currentCallout.contentView setContentViewInset:UIEdgeInsetsMake(0.0f,0.0f,0.0f,0.0f)];'但不起作用......有什么不对? – bubudrc 2015-10-21 19:00:05