美文网首页
swift - iOS 15以后设置 tableview 的 s

swift - iOS 15以后设置 tableview 的 s

作者: Matsonga | 来源:发表于2023-02-27 10:17 被阅读0次

如图所示:


多出大约20像素
swift
        if #available(iOS 15.0, *) {
            tableView?.sectionHeaderTopPadding = 0
        }

        if #available(iOS 15.0, *) {
            UITableView.appearance().sectionHeaderTopPadding = 0
        }
Object - c

        if (@available(iOS 15.0, *)) {
            _tableView.sectionHeaderTopPadding = 0;
        }

        if (@available(iOS 15.0, *)) {
            [UITableView appearance].sectionHeaderTopPadding = 0;
        }

修改后


修改后
# 在 iOS15 中 UITableView 新增属性和方法:
 
@property (nonatomic, getter=isPrefetchingEnabled) BOOL prefetchingEnabled
 
@property (nonatomic) CGFloat fillerRowHeight
 
@property (nonatomic) CGFloat sectionHeaderTopPadding
 
@property (nonatomic) BOOL allowsFocus
 
@property (nonatomic) BOOL allowsFocusDuringEditing
 
- (void)reconfigureRowsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths 
 
- (BOOL)tableView:(UITableView *)tableView selectionFollowsFocusForRowAtIndexPath:(NSIndexPath *)indexPath

相关文章

网友评论

      本文标题:swift - iOS 15以后设置 tableview 的 s

      本文链接:https://www.haomeiwen.com/subject/rdehldtx.html