1

In an XCode iPad application, I use a storyboard with a view and an UIImageView inside, defined in the Interface Builder. If I try to change the location of the UIImageView using the SetFrame command [myImageView setFrame:CgRectMake...], the image does not change position on the screen. Is the setFrame command enough ? Thanks.

Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89

2 Answers2

7

I would go through a checklist and see that the setup is good:

  1. Check your IBOutlet - if your UIImageView isn't hooked up, nothing you try calling on it will work.
  2. Check the autoresize mask - If this is a non-trivial layout where some views are nested within one another, there might be unexpected results.
  3. Make sure you're not using Autolayout - This can be done by selecting the storyboard itself and making sure the "Use Autolayout" checkbox within the file inspector (cmd+alt+1) is not ticked (Ticked by default).

enter image description here

Stavash
  • 14,244
  • 5
  • 52
  • 80
0

I'm not sure but does the UIImageView need to be redrawn after you change it's location as this is often the case in programming?

CreativeAbyss
  • 313
  • 1
  • 18