[英]pin a UIButton to a MapView
我在annotationView上創建一個UIButton,如下所示:
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
CGPoint point = [mainMapView convertCoordinate:sac.coordinate toPointToView:self.smallView];
button.frame = CGRectMake(point.x - 30, point.y - 30, 60, 60);
它工作得很好,但是當我移動地圖時,按鈕不隨地圖移動。 有沒有辦法用CGRectMake
繪制按鈕,將button.frame
放在地圖而不是視圖上?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.