当前位置:网站首页>Grouped uitableview has 20px of extra padding at the bottom

Grouped uitableview has 20px of extra padding at the bottom

2022-06-25 06:36:00 javail

problem :

Grouped table views seem to have extra padding on the bottom in iOS 6 (iOS 5 does not have it), but I can't find any documentation that suggests this is correct / expected behavior. The group table view appears to be in iOS 6 There is extra padding at the bottom of the (iOS 5 No, ), But I can't find any indication that this is true / Documentation of expected behavior .

This affects the example projects as well, for instance the SimpleTableView project in the TableViewSuite example. This also affects the sample project , for example TableViewSuite In the example SimpleTableView project .I think I had to change the style in the AppDelegate to 'grouped', and updated the SDK to iOS 6, but no other changes have been made to the project. I think I must AppDelegate The style of is changed to “ grouping ”, And will SDK Updated to iOS 6, But no other changes were made to the project .

Investigating revealed that there are 10px reserved for header and footer views, plus some 20px that can't be accounted for. The survey shows that , Yes 10px Header and footer reservations , Add some more 20px Cannot occupy .There are no actual header or footer views ( tableHeaderView and tableFooterView are nil , and implementing and returning nil for eg viewForFooterInSection does nothing). There is no actual header or footer view ( tableHeaderView and tableFooterView yes nil , And for example viewForFooterInSection Implement and return nil Don't do anything? ).I cannot find any '20' value on the tableView itself, though I may have missed something of course. I am here tableView Can't find any on itself “20” value , Although of course I may have missed something .

Adding a zero-size view for the footer does nothing, but adding a 1px square view causes the extra padding to vanish. Adding a zero size view to the footer has no effect , But add one 1px The square view causes the extra padding to disappear .eg: for example :

tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0,0,1,1)];

It does take up 1px of height still, so the bottom padding is now 11px , but this is far less noticeable than 20. And now setting the sectionFooterHeight to 0 will result in only 1px of bottom-space. It takes 1px The height is still , So the bottom fill is now 11px , But this is better than 20 Far less obvious , The current settings sectionFooterHeight by 0 Will result in only 1px Bottom space .

My question is: what? My question is : what ?And how can I completely remove it? How can I delete it completely ?This isn't anything mission-critical, but it is extremely weird, undesirable, and as far as I can tell it's undocumented. This is not any critical task , But it's very strange , Not an option , And as far as I know it has no record .

Please note - its copy past question from apple dev forum. Please note that - It replicates past problems from the Apple Development Forum .But I have exactly the same issue and I don't understand how to solve it too. But I have exactly the same problem , I don't know how to solve it .


Solution :

Reference resources : https://stackoom.com/en/question/xcnC
原网站

版权声明
本文为[javail]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202201234287112.html