I have a map app where the user can place waypoints manually. I would like for them to press the waypoint button and have a waypoint placed in the center of their currently visible view on the content view.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
Need to account for how zoomed it is, then I can convert the content offset to the size of the full image and add some. /// this is the full size of the map image CGSize fullSize = CGPointMake(13900, 8400);
I'm afraid you'd have to calculate it yourself.
contentSize
returns size of the scrolled content,contentOffset
gives you the origin of the scroll view inside the content. Then withscrollView.bounds.size
you can find the center of the view.Haven't tested this, but maybe you could convert
scrollView.center
to your scrolled map like this: