@@ -155,9 +155,17 @@ - (void)showTipStr:(NSString *)tipStr{
155
155
UITextView *textV = [UITextView new ];
156
156
textV.backgroundColor = [UIColor clearColor ];
157
157
textV.editable = NO ;
158
- textV.font = [UIFont systemFontOfSize: 15 ];
159
- textV.textColor = [UIColor whiteColor ];
160
- textV.text = tipStr;
158
+
159
+ NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc ] init ];
160
+ paragraphStyle.maximumLineHeight = 25 ;
161
+ paragraphStyle.minimumLineHeight = 25 ;
162
+ NSDictionary *attributes = @{
163
+ NSFontAttributeName : [UIFont systemFontOfSize: 15 ],
164
+ NSForegroundColorAttributeName : [UIColor whiteColor ],
165
+ NSParagraphStyleAttributeName : paragraphStyle,
166
+ };
167
+ textV.attributedText = [[NSAttributedString alloc ] initWithString: tipStr attributes: attributes];
168
+
161
169
[RACObserve (textV, contentSize) subscribeNext: ^(id x) {
162
170
CGFloat diffY = MAX (0 , (textV.size .height - textV.contentSize .height )/3 );
163
171
textV.contentInset = UIEdgeInsetsMake (diffY, 0 , 0 , 0 );
0 commit comments