views:

117

answers:

1

To understand my problem let's follow this steps.

  1. Open - XCode -> New Project -> View based application.
  2. Open View Controller.xib file.
  3. Drag an image-view into viewController's view.
  4. Place that image view on center of viewController's view.
  5. Apply size of 125x125 to image-view.
  6. Take any image with dimension of 320 width & 460 height.
  7. Drag that image into your application resources directory.
  8. Now, Again back to .xib File & select image-view
  9. Set image (which is in your resources) to image-view
  10. Set Image-view Mode to - Center

Ok. Let me explain the situation now.

  • after performing all above steps - image-view has an image which is larger than image-view's size.
  • However, Image-view places that image on center & in View controller image-view is looking proper ( not scaled ).
  • But When you run your application, image-view will be displayed in size of 320x460. ( but it is not actually scaled. )

Now, I can't find the reason, why interface builder is displaying something else & simulator/iphone is displaying something else ?

My Query.

  • I want the image's center portion within image-view no matter what image size is.

Thanks in advance for sharing your knowledge.

Sagar.

+2  A: 

In the IB click on your image and in drawing section Check "Clip subviews" Option

mihirpmehta
I have put image's link but it's not displayed...!!!
mihirpmehta