@@ -79,14 +79,14 @@ - (void)loadView {
79
79
[replyLabel setFont: [UIFont systemFontOfSize: 12 .0f ]];
80
80
[replyLabel setTextColor: [UIColor darkGrayColor ]];
81
81
[replyLabel setNumberOfLines: 0 ];
82
- [tableView addSubview: replyLabel];
82
+ [textView addSubview: replyLabel];
83
83
}
84
84
85
85
- (void )viewDidLoad {
86
86
[super viewDidLoad ];
87
87
88
88
if ([entry body ] != nil && ![[entry body ] isEqualToString: @" " ]) {
89
- CGFloat replyPadding = 8 .0f ;
89
+ CGFloat replyPadding = 8.0 ;
90
90
91
91
NSString *bodyText = [entry body ];
92
92
bodyText = [bodyText stringByReplacingOccurrencesOfString: @" <p>" withString: @" \n\n " ];
@@ -97,9 +97,13 @@ - (void)viewDidLoad {
97
97
NSString *replyText = [NSString stringWithFormat: @" %@ : %@ " , [[entry submitter ] identifier ], bodyText];
98
98
[replyLabel setText: replyText];
99
99
100
- CGRect replyFrame = CGRectMake (replyPadding, -replyPadding, [tableView bounds ].size .width - replyPadding - replyPadding, [tableView bounds ].size .height / 3 .0f );
101
- replyFrame.size .height = [[replyLabel text ] sizeWithFont: [replyLabel font ] constrainedToSize: replyFrame.size lineBreakMode: [replyLabel lineBreakMode ]].height ;
102
- replyFrame.origin .y -= replyFrame.size .height ;
100
+ CGSize replySize = CGSizeMake ([textView bounds ].size .width - replyPadding - replyPadding, [textView bounds ].size .height / 3 .0f );
101
+ replySize.height = ceilf ([[replyLabel text ] sizeWithFont: [replyLabel font ] constrainedToSize: replySize lineBreakMode: [replyLabel lineBreakMode ]].height );
102
+
103
+ CGRect replyFrame;
104
+ replyFrame.size = replySize;
105
+ replyFrame.origin .x = replyPadding;
106
+ replyFrame.origin .y = textView.contentInset .top - replyPadding - replyFrame.size .height ;
103
107
[replyLabel setFrame: replyFrame];
104
108
}
105
109
}
0 commit comments