0

My app supports both portrait and landscape mode. I have a TableViewController that has some issues when i rotate from portrait mode to landscape mode. I want subviews of TableView not to change neither orientation nor size. But i cannot find the way. I tried from storyboard to uncheck Autoresize subviews but it did not work. My TableView is into a TabBarController. It is strange, that in another ViewController i have a similar TableView with exactly the same attributes that works fine. So i added some pics with the problem and with what i want.

The only code that handles TableView orientation changes is in viewDidLoadMethod the below:

    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

The first image is from Portrait mode

Portrait Mode

The second from troublesome Landscape mode

Landscape mode

And the third from the right TableViewController and the result that i want

Expected Result

Any advice would be helpful.

hoya21
  • 893
  • 7
  • 24

2 Answers2

0

What you can do is setting a constraint on your imageView and force the width and height to stay fixed.

shinyuX
  • 1,519
  • 1
  • 9
  • 20
0

The issue was in size inspector. I had to keep autoresizing of ImageView only TopLeft.

hoya21
  • 893
  • 7
  • 24