mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-11 22:06:40 +10:00
frame layout of ChatRightTextCell
This commit is contained in:
@@ -11,8 +11,8 @@ import UIKit
|
||||
class ChatRightBaseCell: ChatBaseCell {
|
||||
|
||||
@IBOutlet weak var dotImageView: UIImageView!
|
||||
@IBOutlet weak var gapBetweenDotImageViewAndBubbleConstraint: NSLayoutConstraint!
|
||||
|
||||
// @IBOutlet weak var gapBetweenDotImageViewAndBubbleConstraint: NSLayoutConstraint!
|
||||
|
||||
var messageSendState: MessageSendState = .NotSend {
|
||||
didSet {
|
||||
switch messageSendState {
|
||||
|
||||
@@ -26,9 +26,22 @@ class ChatRightTextCell: ChatRightBaseCell {
|
||||
|
||||
var longPressAction: (() -> Void)?
|
||||
|
||||
func makeUI() {
|
||||
|
||||
let fullWidth = UIScreen.mainScreen().bounds.width
|
||||
|
||||
let halfAvatarSize = YepConfig.chatCellAvatarSize() / 2
|
||||
|
||||
avatarImageView.center = CGPoint(x: fullWidth - halfAvatarSize - YepConfig.chatCellGapBetweenWallAndAvatar(), y: halfAvatarSize)
|
||||
}
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
backgroundColor = UIColor.redColor()
|
||||
|
||||
makeUI()
|
||||
|
||||
// avatarImageViewTrailingConstraint.constant = YepConfig.chatCellGapBetweenWallAndAvatar()
|
||||
|
||||
textContentTextView.textContainer.lineFragmentPadding = 0
|
||||
@@ -107,7 +120,23 @@ class ChatRightTextCell: ChatRightBaseCell {
|
||||
// textContentTextViewLeadingConstraint.constant = YepConfig.chatTextGapBetweenWallAndContentLabel() - YepConfig.ChatCell.magicWidth
|
||||
// }
|
||||
|
||||
contentView.layoutIfNeeded()
|
||||
// contentView.layoutIfNeeded()
|
||||
|
||||
textContainerView.frame = CGRect(x: CGRectGetMinX(avatarImageView.frame) - YepConfig.chatCellGapBetweenTextContentLabelAndAvatar() - textContentLabelWidth, y: 3, width: textContentLabelWidth, height: bounds.height - 3 * 2)
|
||||
|
||||
println(textContainerView.frame)
|
||||
|
||||
bubbleBodyImageView.frame = CGRectInset(textContainerView.frame, -12, -3)
|
||||
|
||||
println(bubbleBodyImageView.frame)
|
||||
|
||||
bubbleTailImageView.center = CGPoint(x: CGRectGetMaxX(bubbleBodyImageView.frame), y: CGRectGetMidY(avatarImageView.frame))
|
||||
|
||||
println(bubbleTailImageView.frame)
|
||||
|
||||
dotImageView.center = CGPoint(x: CGRectGetMinX(bubbleBodyImageView.frame) - 5, y: CGRectGetMidY(bubbleBodyImageView.frame))
|
||||
|
||||
println(dotImageView.frame)
|
||||
|
||||
if let sender = message.fromFriend {
|
||||
AvatarCache.sharedInstance.roundAvatarOfUser(sender, withRadius: YepConfig.chatCellAvatarSize() * 0.5) { [weak self] roundImage in
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<subviews>
|
||||
<textView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" text="Text Content" id="em7-jr-W4a" customClass="ChatTextView" customModule="Yep" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="92" height="125"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
|
||||
Reference in New Issue
Block a user