mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-14 15:26:40 +10:00
frame layout of ChatLeftTextCell
This commit is contained in:
@@ -21,9 +21,22 @@ class ChatLeftTextCell: ChatBaseCell {
|
||||
// @IBOutlet weak var textContentTextViewLeadingConstraint: NSLayoutConstraint!
|
||||
//@IBOutlet weak var textContentTextViewWidthConstraint: NSLayoutConstraint!
|
||||
|
||||
func makeUI() {
|
||||
|
||||
let fullWidth = UIScreen.mainScreen().bounds.width
|
||||
|
||||
let halfAvatarSize = YepConfig.chatCellAvatarSize() / 2
|
||||
|
||||
avatarImageView.center = CGPoint(x: YepConfig.chatCellGapBetweenWallAndAvatar() + halfAvatarSize, y: halfAvatarSize)
|
||||
}
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
backgroundColor = UIColor.greenColor()
|
||||
|
||||
makeUI()
|
||||
|
||||
// avatarImageViewLeadingConstraint.constant = YepConfig.chatCellGapBetweenWallAndAvatar()
|
||||
|
||||
textContentTextView.textContainer.lineFragmentPadding = 0
|
||||
@@ -85,7 +98,22 @@ class ChatLeftTextCell: ChatBaseCell {
|
||||
// textContentTextViewTrailingConstraint.constant = YepConfig.chatTextGapBetweenWallAndContentLabel() - YepConfig.ChatCell.magicWidth
|
||||
// }
|
||||
|
||||
contentView.layoutIfNeeded()
|
||||
// contentView.layoutIfNeeded()
|
||||
|
||||
|
||||
textContainerView.frame = CGRect(x: CGRectGetMaxX(avatarImageView.frame) + YepConfig.chatCellGapBetweenTextContentLabelAndAvatar(), 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: CGRectGetMinX(bubbleBodyImageView.frame), y: CGRectGetMidY(avatarImageView.frame))
|
||||
|
||||
println(bubbleTailImageView.frame)
|
||||
|
||||
|
||||
|
||||
if let sender = message.fromFriend {
|
||||
AvatarCache.sharedInstance.roundAvatarOfUser(sender, withRadius: YepConfig.chatCellAvatarSize() * 0.5) { [weak self] roundImage in
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<subviews>
|
||||
<textView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" text="Text Content" id="o2v-vm-ItZ" customClass="ChatTextView" customModule="Yep" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="92" height="123"/>
|
||||
<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