@@ -46,17 +46,17 @@ -(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
4646
4747 [self .contentView addSubview: _profilePicture];
4848
49- _timeLabel = [[UILabel alloc ] initWithFrame: CGRectMake (bTimeLabelPadding, 0 , 0 , 0 ) ];
49+ _timeLabel = [[UILabel alloc ] initWithFrame: CGRectZero ];
5050
5151 _timeLabel.font = [UIFont italicSystemFontOfSize: 12 ];
5252 if ([BChatSDK config ].messageTimeFont ) {
5353 _timeLabel.font = [BChatSDK config ].messageTimeFont ;
5454 }
5555
56- _timeLabel.textColor = [UIColor lightGrayColor ];
56+ _timeLabel.textColor = [UIColor grayColor ];
5757 _timeLabel.userInteractionEnabled = NO ;
5858
59- [self .contentView addSubview: _timeLabel];
59+ [bubbleImageView addSubview: _timeLabel];
6060
6161 _nameLabel = [[UILabel alloc ] initWithFrame: CGRectMake (bTimeLabelPadding, 0 , 0 , 0 )];
6262 _nameLabel.userInteractionEnabled = NO ;
@@ -252,13 +252,11 @@ -(void) layoutSubviews {
252252 // TODO: Fix this
253253 float xMargin = _profilePicture.image ? 0 : 0 ;
254254
255- // Layout the date label this will be the full size of the cell
256- // This will automatically center the text in the y direction
257- // we'll set the side using text alignment
258- [_timeLabel setViewFrameWidth: self .fw - bTimeLabelPadding * 2.0 ];
255+ [_timeLabel setViewFrameWidth: l.bubbleWidth - l.bubblePadding * 2.0 ];
256+ [_timeLabel.keepBottomInset setEqual: l.bubblePadding - 4 ];
259257
260258 // We don't want the label getting in the way of the read receipt
261- [_timeLabel setViewFrameHeight: l.cellHeight * 0.8 ];
259+ [_timeLabel setViewFrameHeight: bTimeLabelHeight ];
262260
263261 [_readMessageImageView setViewFrameWidth: bReadReceiptWidth];
264262 [_readMessageImageView setViewFrameHeight: bReadReceiptHeight];
@@ -273,18 +271,20 @@ -(void) layoutSubviews {
273271 if (!isMine) {
274272 [_profilePicture setViewFrameX: _profilePicture.hidden ? 0 : l.profilePicturePadding];
275273 [bubbleImageView setViewFrameX: l.bubbleMargin + _profilePicture.fx + _profilePicture.fw + xMargin];
276- [_nameLabel setViewFrameX: bTimeLabelPadding];
274+ // [_nameLabel setViewFrameX:bTimeLabelPadding];
275+ [_timeLabel.keepRightInset setEqual: l.bubblePadding];
277276
278- _timeLabel.textAlignment = NSTextAlignmentRight ;
279- _nameLabel.textAlignment = NSTextAlignmentLeft;
277+ _timeLabel.textAlignment = NSTextAlignmentLeft ;
278+ // _nameLabel.textAlignment = NSTextAlignmentLeft;
280279 }
281280 else {
282281 [_profilePicture setViewFrameX: _profilePicture.hidden ? self .contentView.fw : self .contentView.fw - _profilePicture.fw - l.profilePicturePadding];
283282 [bubbleImageView setViewFrameX: _profilePicture.fx - l.bubbleWidth - l.bubbleMargin - xMargin];
284283 // [_nameLabel setViewFrameX: bTimeLabelPadding];
284+ [_timeLabel.keepRightInset setEqual: l.bubblePadding + bTailSize];
285285
286- _timeLabel.textAlignment = NSTextAlignmentLeft ;
287- _nameLabel.textAlignment = NSTextAlignmentRight;
286+ _timeLabel.textAlignment = NSTextAlignmentRight ;
287+ // _nameLabel.textAlignment = NSTextAlignmentRight;
288288
289289// // We need to make sure the time label isn't in the way if there is a users name
290290// if (self.fh < 50) {
0 commit comments