Iphone 6+ / Landscape orientation : The chat tableview was properly refreshed while enlarging/reducing it.

This commit is contained in:
Yannick Le Collen 2014-12-18 10:50:31 +01:00
parent 66ad9dc3b3
commit cd2bd55652
3 changed files with 13 additions and 0 deletions

View file

@ -16,6 +16,7 @@
#import <UIKit/UIKit.h>
#import "CustomImageView.h"
#import "RoomMessage.h"
// Room Message Table View Cell
@interface RoomMessageTableCell : UITableViewCell
@ -28,6 +29,9 @@
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *attachViewWidthConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *attachViewTopConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *dateTimeLabelContainerTopConstraint;
// reference to the linked message
@property (strong, nonatomic) RoomMessage *message;
@end
@interface IncomingMessageTableCell : RoomMessageTableCell

View file

@ -26,4 +26,12 @@
@implementation OutgoingMessageTableCell
- (void)layoutSubviews {
[super layoutSubviews];
// ensure that the text is still aligned to the left side of the screen
// even during animation while enlarging/reducing the viewcontroller (with UISplitViewController)
CGFloat leftInset = self.message.maxTextViewWidth - self.message.contentSize.width;
self.messageTextView.contentInset = UIEdgeInsetsMake(0, leftInset, 0, -leftInset);
}
@end

View file

@ -1202,6 +1202,7 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
}
// Restore initial settings
cell.message = message;
cell.attachmentView.imageURL = nil; // Cancel potential attachment loading
cell.attachmentView.hidden = YES;
cell.playIconView.hidden = YES;