KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am making a simple app for the iPad that consists of a giant image that you can zoom-in/out on and navigate. This image is placed inside a UIImageView , which is then placed inside a UIScrollView . The navigation and zooming work 100% fine; however, the image is loaded at a fixed aspect-ratio to fit the screen, and will never change (even when zooming-in). I have a feeling that Interface Builder is setting some property that I'm not aware of, but I've tried everything that I can think of to fix this. The Problem: When the app initially loads, the contents inside the UIScrollView is automatically re-sized to exactly fit the iPad screen by having its aspect ratio changed./fixed; the actual image is giant (way bigger than the iPad resolution). This scaled aspect ratio remains even when zooming in on the image, and causes the image to look stretched. No matter what I try, I cannot stop the iPad from automatically rescaling my image. I simply want the app to start with my image displayed normally (100% zoom) on the iPad, with the portion that currently fits on the iPad screen being the top-left corner of the image. What I've tried to fix it: I tried changing the UIImageView's content-mode in Interface Builder to "Top-Left". This appeared to work perfectly, but then I realized that the UIScrollView would not let you scroll around the image past the initially displayed portion (the top-left). You could zoom-in on the top-left portion and scroll, but never past what was initially shown on the screen. Code: Here's the code that I'm using to setup the views. imageScrollView is the UIScrollView , and imageView is the UIImageView . They are both IBOutlets . // Set the needed attributes of the imageView
Tags (comma-separated)
Save Edits
Cancel