Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d8c43ec

Browse files
项目成员 - 权限设置提示语的行间距调整
1 parent 2d7ad5f commit d8c43ec

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎Coding_iOS/Controllers/ValueListViewController.m‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,17 @@ - (void)showTipStr:(NSString *)tipStr{
155155
UITextView *textV = [UITextView new];
156156
textV.backgroundColor = [UIColor clearColor];
157157
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+
161169
[RACObserve(textV, contentSize) subscribeNext:^(id x) {
162170
CGFloat diffY = MAX(0, (textV.size.height - textV.contentSize.height)/3);
163171
textV.contentInset = UIEdgeInsetsMake(diffY, 0, 0, 0);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /