sizewithfont

    8Nhiệt

    2Trả lời

    tôi thấy một số phương pháp UIStringDrawing đã được cập nhật để sử dụng NSLineBreakMode thay vì UILineBreakMode trong iOS 6.0: Ví dụ: - (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)si

    11Nhiệt

    2Trả lời

    Tôi có NSString và tôi muốn biết chiều cao của nó để tạo UILabel thích hợp. Làm chiều cao NSString *string = @"this is an example"; CGSize size = [string sizeWithFont:[UIFont systemFontOfSize:10.0f]