views:

92

answers:

1

Hi all, In my iphone app, im using a UITableView with each row containing 3 photos, and they are separated by a space = 50.0 pixels.

When I change t landscape mode, I want this space to increase to 100.0 , but I cant achieve this.

In the orientationChanged method, I specified that I want the space to be 50 in portrait and 100 in Landscape, but when I run the application and switch to landscape mode, what happens is that the cells that were already loaded in portrait mode still have a space of 50 between them, while those which haven't been loaded in portrait mode and are loaded in Landscape mode have a space of 100.

so what should I do ? should I reload the previously loaded ones again ? and how ?

thanks in advance !!

+2  A: 

you can get visible cels and modify them using UITableView visibleCells or you can just reload data using UITableView reloadData

GameBit
when I use reloadData, i get the same problem since all the previously loaded cells are used again ( because of the method : dequeReusableCellWithIDentifier ) so there is no chance that they are loaded and initialized again.moreover, if I don't use the previous function, I get it working correctly and the cells are initialized againso my question now is how can I delete all the items in the list of reused cells after changing orientation ?
SLA
by "the previous function" i meant the "dequeReusableCellWithIdentifier"
SLA
Then use a different identifier depending on the table orientation.
toxaq
Or reconfigure the cell depending on the current orientation.
tc.