gpt4 book ai didi

ios - cellForRowAtIndexPath 在设备旋转期间不调用

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:23:46 26 4
gpt4 key购买 nike

我有一个带有一些委托(delegate)方法的 UITableView。在第一次加载期间一切正常,但在旋转期间我看到方法 cellForRowAtIndexPath 不记得了。为什么?我的委托(delegate)方法是:

-(NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section{
//.....
}

-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
//......
}
- (UITableViewCell *)tableView:(UITableView *)aTableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath{

//...This method is not called during the rotation of the device...

}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//.......
}

最佳答案

旋转发生后,您需要在 shouldAutorotateToInterfaceOrientation 方法中使用 [tableView reloadData] 手动刷新表格数据。

关于ios - cellForRowAtIndexPath 在设备旋转期间不调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13141383/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com