【发布时间】:2012-08-21 15:17:44
【问题描述】:
我在 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 放在地图上而不是视图上?
【问题讨论】:
标签: iphone uibutton mkmapview cgrect