iOS collectionview 只有一个item时如何靠左

2021-09-09  本文已影响0人  iOS门三闫

SEL sel = NSSelectorFromString(@"_setRowAlignmentsOptions:");

    if([layout respondsToSelector:sel]) {

        ((void(*)(id,SEL,NSDictionary*)) objc_msgSend)(layout,sel, @{@"UIFlowLayoutCommonRowHorizontalAlignmentKey":@(NSTextAlignmentLeft),@"UIFlowLayoutLastRowHorizontalAlignmentKey" : @(NSTextAlignmentLeft),@"UIFlowLayoutRowVerticalAlignmentKey" : @(NSTextAlignmentCenter)});

    }

上一篇 下一篇

猜你喜欢

热点阅读