开发者

xcode: Creating a zoomable image with buttons inside

开发者 https://www.devze.com 2023-02-02 04:19 出处:网络
Hello and first of all a happy new year to everyone!! I\'m new to Stack Overflow but I used it often to get answers to my questions. But now I\'m standing at the wall with no idea to get further on.

Hello and first of all a happy new year to everyone!! I'm new to Stack Overflow but I used it often to get answers to my questions. But now I'm standing at the wall with no idea to get further on.

What I want to do: xcode - iPad Project

  1. App is having a very big picture (4000px to 5000px)
  2. App should start with picture scaled down to see the whole image
  3. Picture should be z开发者_StackOverflow社区oomable and dragable
  4. If picture is zoomed out you should have several buttons or selectable areas (invisible buttons) to display (pop up) a textfield. These buttons should also be zoomed wihtin the image. So

Example: Picture of a face

  • Face is zoomed out and so the eye fills the whole display
  • User touches the eyebrow
  • A pop up is shown with a table "The eyebrow protects the eye from dust"

Point 1 and 2(and 3) I was able to set up with the tutorial from this Site: http://vimeo.com/1642150


You need to hook up the delegate method for the UIScrollView.

- (void)scrollViewDidZoom:(UIScrollView *)scrollView
{
   if (scrollView.zoomScale > EXTRA_INFO_THRESHOLD)
   {
      [self displayExtraInfoLayer];
   }
   else
   {
      [self hideExtraInfoLayer];
   }
}

Id guess you could dump those buttons into a UIView container and add that to the view hierachy in displayExtraInfoLayer above the scrollview.

0

精彩评论

暂无评论...
验证码 换一张
取 消