views:

28

answers:

1

Hello people,

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?

+2  A: 

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

imageView.autoresizingMask = ( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight );

The way you do it, you override the autoresizingMask.

objneodude
Yes that was the solution, thanks a lot
Marco