2014-12-07 93 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