Change font type and size of UIActionSheet title string

后端 未结 6 909
误落风尘
误落风尘 2021-02-06 05:29

I have a UIActionSheet with title string \"DO: These tasks\". In the title string, the substring \"DO:\" should be Bold(with a particular font size) and the substring \"These ta

6条回答
  •  南旧
    南旧 (楼主)
    2021-02-06 06:20

    Following may be useful.

    - (void)willPresentActionSheet:(UIActionSheet *)actionSheet
    {
        [actionSheet.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
            if ([obj isKindOfClass:[UIButton class]]) {
                UIButton *button = (UIButton *)obj;
                button.titleLabel.font = [UIFont systemFontOfSize:15];
            }
        }];
    
    }
    

提交回复
热议问题