diff --git a/xplan-ios/Base/UI/InputView/InputView/QInputBarViewConfiguration.m b/xplan-ios/Base/UI/InputView/InputView/QInputBarViewConfiguration.m index e6a2a059..e28b1373 100644 --- a/xplan-ios/Base/UI/InputView/InputView/QInputBarViewConfiguration.m +++ b/xplan-ios/Base/UI/InputView/InputView/QInputBarViewConfiguration.m @@ -14,20 +14,22 @@ { QInputBarViewConfiguration *configuration = [QInputBarViewConfiguration new]; - if (@available(iOS 11.0, *)) { - NSBundle *bundle = [NSBundle bundleForClass:[QInputBarViewConfiguration class]]; - configuration.inputBarBackgroundColor = [UIColor colorNamed:@"q_input_gray_bg" inBundle:bundle compatibleWithTraitCollection:nil]; - configuration.inputBarBoardColor = [UIColor colorNamed:@"q_border223" inBundle:bundle compatibleWithTraitCollection:nil]; - configuration.textColor = [UIColor colorNamed:@"q_black_gray" inBundle:bundle compatibleWithTraitCollection:nil]; - configuration.textViewBackgroundColor = [UIColor colorNamed:@"q_input" inBundle:bundle compatibleWithTraitCollection:nil]; - configuration.recordButtonTitleColor = [UIColor colorNamed:@"q_black_white" inBundle:bundle compatibleWithTraitCollection:nil]; - } else { - configuration.inputBarBackgroundColor = [UIColor colorWithRed:242/255.0f green:242/255.0f blue:242/255.0f alpha:1]; - configuration.inputBarBoardColor = [UIColor colorWithRed:223/255.0f green:223/255.0f blue:223/255.0f alpha:1]; - configuration.textColor = [UIColor blackColor]; - configuration.textViewBackgroundColor = [UIColor whiteColor]; - configuration.recordButtonTitleColor = [UIColor darkGrayColor]; - } +// if (@available(iOS 11.0, *)) { +// NSBundle *bundle = [NSBundle bundleForClass:[QInputBarViewConfiguration class]]; +//// configuration.inputBarBackgroundColor = [UIColor colorNamed:@"q_input_gray_bg" inBundle:bundle compatibleWithTraitCollection:nil]; +// configuration.inputBarBoardColor = [UIColor colorNamed:@"q_border223" inBundle:bundle compatibleWithTraitCollection:nil]; +//// configuration.textColor = [UIColor colorNamed:@"q_black_gray" inBundle:bundle compatibleWithTraitCollection:nil]; +// configuration.textViewBackgroundColor = [UIColor colorNamed:@"q_input" inBundle:bundle compatibleWithTraitCollection:nil]; +// configuration.recordButtonTitleColor = [UIColor colorNamed:@"q_black_white" inBundle:bundle compatibleWithTraitCollection:nil]; +// } else { +// +// +// } + configuration.inputBarBoardColor = [UIColor clearColor]; + configuration.textColor = [UIColor blackColor]; + configuration.recordButtonTitleColor = [UIColor darkGrayColor]; + configuration.inputBarBackgroundColor = [UIColor colorWithRed:242/255.0f green:242/255.0f blue:242/255.0f alpha:1]; + configuration.textViewBackgroundColor = [UIColor whiteColor]; configuration.inputBarHeightChangeAnimationDuration = 0.2; configuration.keyboardSendEnabled = YES; configuration.inputBarHeightChangeAnimationDuration = 0.2; diff --git a/xplan-ios/Main/Monents/Presenter/XPMonentsLayoutConfig.m b/xplan-ios/Main/Monents/Presenter/XPMonentsLayoutConfig.m index 6972a2d2..11ecb553 100644 --- a/xplan-ios/Main/Monents/Presenter/XPMonentsLayoutConfig.m +++ b/xplan-ios/Main/Monents/Presenter/XPMonentsLayoutConfig.m @@ -24,7 +24,7 @@ ///图片的高度 rowHeight += [self monentsPicHeight:monents]; ///如果没有图片的话 间隙就只有一个 - if (monents.type == MonentsContentType_Picture) { + if (monents.type == MonentsContentType_Picture && monents.content.length > 0) { rowHeight += (kMONENTS_CONTENT_SPACAE_HEIGHT * 2); }else { rowHeight += kMONENTS_CONTENT_SPACAE_HEIGHT; @@ -37,9 +37,6 @@ } + (CGFloat)monentsPicHeight:(MonentsInfoModel *)monents { - if (monents.type == MonentsContentType_Picture) { - - } ///计算图片的高度 NSInteger picCount = monents.dynamicResList.count; CGFloat picHeight = 0; @@ -85,6 +82,7 @@ } [attributedString appendAttributedString:[self creatStrAttrByStr:monents.content attributed:@{NSFontAttributeName : [UIFont systemFontOfSize:15]}]]; attributedString.yy_lineSpacing = 5; + attributedString.yy_lineBreakMode = NSLineBreakByWordWrapping; monents.contentAttribute = attributedString; } @@ -100,7 +98,7 @@ container.maximumNumberOfRows = numberOfLines; } YYTextLayout *realLayout = [YYTextLayout layoutWithContainer:container text:monents.contentAttribute]; - CGFloat contentHeight = realLayout.textBoundingSize.height + 15; + CGFloat contentHeight = realLayout.textBoundingSize.height; monents.contentHeight =contentHeight; return contentHeight + foldHeight; } diff --git a/xplan-ios/Main/Monents/View/Cell/XPMonentsEmptyTableViewCell.m b/xplan-ios/Main/Monents/View/Cell/XPMonentsEmptyTableViewCell.m index c4314f4b..2ee75302 100644 --- a/xplan-ios/Main/Monents/View/Cell/XPMonentsEmptyTableViewCell.m +++ b/xplan-ios/Main/Monents/View/Cell/XPMonentsEmptyTableViewCell.m @@ -28,6 +28,7 @@ } #pragma mark - Private Method - (void)initSubViews { + self.backgroundColor = [UIColor clearColor]; self.selectionStyle = UITableViewCellSelectionStyleNone; [self.contentView addSubview:self.emptyImageView]; [self.contentView addSubview:self.titleLabel]; diff --git a/xplan-ios/Main/Monents/View/Cell/XPMonentsTableViewCell.m b/xplan-ios/Main/Monents/View/Cell/XPMonentsTableViewCell.m index 65583727..1055367d 100644 --- a/xplan-ios/Main/Monents/View/Cell/XPMonentsTableViewCell.m +++ b/xplan-ios/Main/Monents/View/Cell/XPMonentsTableViewCell.m @@ -185,13 +185,13 @@ make.height.mas_equalTo(picHeight); }]; } else { - self.photoView.hidden = NO; + self.photoView.hidden = YES; [self.photoView mas_updateConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(0); }]; } - CGFloat contentHeight = _monentsInfo.contentHeight <=0 ? [XPMonentsLayoutConfig monentsContentHeight:_monentsInfo] : _monentsInfo.contentHeight; + CGFloat contentHeight = [XPMonentsLayoutConfig monentsContentHeight:_monentsInfo]; [self.textView mas_updateConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(contentHeight); }]; diff --git a/xplan-ios/Main/Monents/View/SubViews/XPMoentsTopicView.m b/xplan-ios/Main/Monents/View/SubViews/XPMoentsTopicView.m index fe5199b7..c5b21350 100644 --- a/xplan-ios/Main/Monents/View/SubViews/XPMoentsTopicView.m +++ b/xplan-ios/Main/Monents/View/SubViews/XPMoentsTopicView.m @@ -99,7 +99,7 @@ _topicImageView.userInteractionEnabled = YES; _topicImageView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xFFFCDD), UIColorFromRGB(0xDFF9FF), UIColorFromRGB(0xF4E5FF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)]; _topicImageView.layer.masksToBounds = YES; - _topicImageView.layer.cornerRadius = 13; + _topicImageView.layer.cornerRadius = 8; } return _topicImageView; } diff --git a/xplan-ios/Main/Monents/View/SubViews/XPMonentsContentView.m b/xplan-ios/Main/Monents/View/SubViews/XPMonentsContentView.m index 6f5c0f98..e3dcd6b7 100644 --- a/xplan-ios/Main/Monents/View/SubViews/XPMonentsContentView.m +++ b/xplan-ios/Main/Monents/View/SubViews/XPMonentsContentView.m @@ -66,6 +66,7 @@ } [attributedString appendAttributedString:[self creatStrAttrByStr:self.monentsInfo.content attributed:@{NSFontAttributeName : [UIFont systemFontOfSize:15]}]]; attributedString.yy_lineSpacing = 5; + attributedString.yy_lineBreakMode = NSLineBreakByWordWrapping; return attributedString; } @@ -132,6 +133,7 @@ _stackView.axis = UILayoutConstraintAxisVertical; _stackView.distribution = UIStackViewDistributionFill; _stackView.alignment = UIStackViewAlignmentLeading; + _stackView.spacing = 0; } return _stackView; } @@ -158,7 +160,8 @@ _contentLabel.font = [UIFont systemFontOfSize:15]; _contentLabel.textColor = UIColorRGBAlpha(0x333333, 1); _contentLabel.preferredMaxLayoutWidth = kMONENTS_CONTENT_MAX_WIDTH; - _contentLabel.lineBreakMode = NSLineBreakByCharWrapping; + _contentLabel.lineBreakMode = NSLineBreakByWordWrapping; + } return _contentLabel; } diff --git a/xplan-ios/Main/Monents/View/XPMonentsDetailViewController.m b/xplan-ios/Main/Monents/View/XPMonentsDetailViewController.m index 8549bf8a..bd597b88 100644 --- a/xplan-ios/Main/Monents/View/XPMonentsDetailViewController.m +++ b/xplan-ios/Main/Monents/View/XPMonentsDetailViewController.m @@ -137,7 +137,7 @@ - (void)initSubViewConstraints { [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.mas_equalTo(self.view); - make.bottom.mas_equalTo(self.view).offset(-UIInputBarViewMinHeight); + make.bottom.mas_equalTo(self.inputBarView.mas_top); }]; [self.commentLabel mas_makeConstraints:^(MASConstraintMaker *make) { @@ -268,7 +268,7 @@ - (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicFold:(MonentsInfoModel *)monentsInfo { self.monentsInfo = monentsInfo; - [self.tableView reloadData]; + [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone]; } #pragma mark - InputBoardDataSource