开发者

UIPickerView and UITableView subview: problem with scroll after new data given

开发者 https://www.devze.com 2023-03-30 17:18 出处:网络
I need assistance. I made a UIPickerView that has a UITableview subview. I iterate over the pickerArray to generate data for the table. As one chooses the component the tableArray changes. Everything

I need assistance. I made a UIPickerView that has a UITableview subview. I iterate over the pickerArray to generate data for the table. As one chooses the component the tableArray changes. Everything works fine except the scroll. If you scroll down and then select another component the tableArray changes but the position you chose remains static. So, if you scroll to the middle of the table and then select another component you will be looking at 开发者_如何学JAVAthe new table data from the middle as well. I want the table to scroll back to the top of the table and not stay at the middle.


On your table view, call:

[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
0

精彩评论

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