tags:

views:

209

answers:

1

I am trying to implement orientation change functionality in my application.I have overrided -(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation.

In this method i change the frame size of the tableview(including the position of the cell items) which is present in the view. The tableview Details:

  1. Added to the view as [self.view addSubView:tableView] in the viewDidLoad method of the view controller;
  2. Cell item (row) has a textfield and a segmented control.
  3. There are 10 cells in the table view and in landscape mode only 2 cells are visible and in potrait mode 5 cells are visible.

I have implemented scroller.

Issue: Certain times on changing the orientation to potrait mode certain segmented controls in the cell are not rendered (Not shown at all).

This happens when i am viewing the last couple of cells in the landscape mode and i change the orientation to potrait mode.

A: 

i think there is a problem in your frame adjustment. I had a similar problem when i was rotating from portrait to landscape. Try to see if the logic behind the rotation process(settings frames, positions etc.) is correct. for me this article was really useful link text

for the tableView you could try to set the autoresizingMask to UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight to see if when rotating the table is adjusting correctly.

tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;

SorinA.