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?

1 Answer 1

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.

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.