Correct way to load a background image for a Page Based application in iOS 5?

后端 未结 1 1432
花落未央
花落未央 2021-01-27 03:59

I\'m working on an iBooks type of app for iOS 5 and have everything working except for the background image. Specifically in landscape mode.

Up to this point I\'ve been

1条回答
  •  借酒劲吻你
    2021-01-27 04:52

    You will need to use a background image for your book and then use a right page image for the right side and a left side image for the left side. These will need to align and match up with the full book background image. You can use a UIImageView for all three. Keep in mind that the left and right page images will need to be perfectly square (except for the spine) with no transparent area, otherwise you get a weird shadowing effect. Also make sure all background colors are set to clear.

    So you will have this hierarchy:

    • Root View (full screen bounds)
      • Book Background View (However big you want)
        • Page View Controller (A little smaller than the book background view, you'll have to play with this until everything looks right)
          • Left page view controller
            • Image of left page and whatever else goes on the page
          • Right page view controller
            • Image of right page and whatever else goes on the page

    I hope this makes sense.

    0 讨论(0)
提交回复
热议问题