0
我有一个图像,我想要在用户位置的右侧,我该如何去做呢?有没有办法获得用户位置的x和y坐标,然后获取图像的x和y以确保其始终位于右侧?找到用户位置的x和y坐标
-(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation{
MKCoordinateRegion region;
region.center = worldView.userLocation.coordinate;
MKCoordinateSpan span;
span.latitudeDelta = 5;
span.longitudeDelta = 5;
region.span = span;
[worldView setRegion:region animated:YES];
UIImage *commentBox = [UIImage imageNamed:@"comment-box"];
UIImageView *commentBoxImageView = [[UIImageView alloc] initWithImage:commentBox];
[self.view addSubview:commentBoxImageView];
}