开发者

Reloading UITableViewCell when changing orientation

开发者 https://www.devze.com 2023-01-17 10:03 出处:网络
In my iphone app, im using a UITableView with each row containing 3 photos, and they are separated by a space = 50.0 pixels.

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 c开发者_开发技巧hange 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 !!


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

0

精彩评论

暂无评论...
验证码 换一张
取 消