- (voID)mapVIEw:(MKMapVIEw *)mv dIDSelectAnnotationVIEw:(MKAnnotationVIEw *)vIEw{ // get vIEw from storyboard ZillowSearchResultAnnotation *annotation = (ZillowSearchResultAnnotation *) vIEw.annotation; PropertyAbstractVIEwController *propertyAbstractVIEwController = [self.storyboard instantiateVIEwControllerWithIDentifIEr:@"PropertyAbstractIDentifIEr"]; propertyAbstractVIEwController.vIEw.frame = CGRectMake(0,100,100); [propertyAbstractVIEwController bind:annotation.data]; [mv addSubvIEw:propertyAbstractVIEwController.vIEw];}解决方法 使用 convertCoordinate:toPointToView:.像:
UIVIEw *vIEw = ...CGPoint p = [mv convertCoordinate:annotation.coordinate topointToVIEw:mv];CGRect frame = CGRectMake(p.x,p.y,vIEw.frame.size.wIDth,vIEw.frame.size.height);vIEw.frame = frame;[self.vIEw addSubVIEw:vIEw];总结
以上是内存溢出为你收集整理的objective-c – 将MKAnnotation坐标转换为视图坐标全部内容,希望文章能够帮你解决objective-c – 将MKAnnotation坐标转换为视图坐标所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)