2

i have implemented a small viewDidLoad() to show an Picture with autoresizing, but it doesn't work, could please someone help me and say what is the mistake in this code in line 3 and 4????

imageView = [[UIImageView alloc] initWithImage:img];
    imageView.frame = self.view.frame;
    imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
    imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

i hope someone could help me?

Marco
  • 461
  • 1
  • 10
  • 22

1 Answers1

5

If im not mistaken you should do it the following way:

imageView.autoresizingMask = ( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight );

The way you do it, you override the autoresizingMask.

mbogh
  • 1,361
  • 11
  • 28