boundingRectWithSize
是iOS上的API,它将计算约束到给定宽度和高度的字符串的大小。 Android上有类似的功能吗?
- (CGRect)boundingRectWithSize:(CGSize)size
options:(NSStringDrawingOptions)options
attributes:(NSDictionary<NSString *,id> *)attributes
context:(NSStringDrawingContext *)context;
https://developer.apple.com/reference/foundation/nsstring/1524729-boundingrectwithsize