iOS 中collectionView flowLayout 私有公共属性 左中右对齐

iOS 中collectionView flowLayout 私有公共属性。
左中右对齐
来源:https://www.jianshu.com/p/de08c2679241

SEL sel = NSSelectorFromString(@"_setRowAlignmentsOptions:");
    if ([self.colView.collectionViewLayout respondsToSelector:sel]) {
        ((void(*)(id,SEL,NSDictionary*))objc_msgSend)(self.colView.collectionViewLayout,sel,
                                                      @{@"UIFlowLayoutCommonRowHorizontalAlignmentKey":@(NSTextAlignmentLeft),
                                                        @"UIFlowLayoutLastRowHorizontalAlignmentKey" : @(NSTextAlignmentLeft),
                                                        @"UIFlowLayoutRowVerticalAlignmentKey" : @(NSTextAlignmentCenter)});
        
    }

你可能感兴趣的:(iOS 中collectionView flowLayout 私有公共属性 左中右对齐)