簡體   English   中英

iOS MapBox標注偏移量不起作用,標注始終出現在相同高度

[英]iOS MapBox Callout offset not working, callout always appear at the same height

似乎盡管我在標注的offset屬性中提供了一個值,但它仍然出現在完全相同的位置。 這個位置比我要顯示的標志圖像高一些。

UIImage * markerImage = [UIImage imageNamed:@“ Flag.png”]; marker = [[RMMarker alloc] initWithUIImage:markerImage anchorPoint:CGPointMake(0.45,0.9)];

marker.calloutOffset = CGPointMake(0,0.5);

//也嘗試過
[marker setCalloutOffset:CGPointMake(0,0.5)];

marker.canShowCallout = YES;

marker.delegate =自我;

這是因為與MapBox iOS SDK中的定位點不同,標注偏移量是絕對值,例如,如果要在定位點上方28像素處顯示標注偏移量,則必須設置: marker.calloutOffset=CGPointMake(0, 28);

如果那沒有幫助,也嘗試設置marker.contentsCenter

希望能幫助到你 ;)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM