浏览代码

1.群公告样式
2.发布提示文案

Steven 7 月之前
父节点
当前提交
d49f14e6c3

+ 7 - 4
KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSSourceDownloadAlert.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina6_12" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -18,7 +18,7 @@
                     <rect key="frame" x="49" y="334" width="295" height="184"/>
                     <subviews>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="下载成功" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lnB-qu-Uf7">
-                            <rect key="frame" x="20" y="15" width="65.333333333333329" height="25"/>
+                            <rect key="frame" x="19.999999999999996" y="15" width="63.666666666666657" height="25"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="25" id="IgN-1l-ZSs"/>
                             </constraints>
@@ -36,9 +36,12 @@
                                 <constraint firstAttribute="width" constant="40" id="sUc-rj-hAl"/>
                             </constraints>
                             <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <connections>
+                                <action selector="cancelAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="AKY-6v-msc"/>
+                            </connections>
                         </button>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="文件已保存到以下地址" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EP8-xw-on3">
-                            <rect key="frame" x="20" y="55" width="163.33333333333334" height="26"/>
+                            <rect key="frame" x="20" y="55" width="159" height="26"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="26" id="fCS-pG-zdm"/>
                             </constraints>

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/GroupNotice/Controller/GroupNoticeEditController.m

@@ -76,7 +76,7 @@
         [KSNetworkingManager imGroupNoticeCreateRequest:KS_POST groupId:self.groupId title:title content:content isTop:[NSString stringWithFormat:@"%d",self.bodyView.isOn] success:^(NSDictionary * _Nonnull dic) {
             [LOADING_MANAGER removeHUD];
             if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
-                [LOADING_MANAGER KSShowMsg:@"设置成功" promptCompletion:^{
+                [LOADING_MANAGER KSShowMsg:@"发布成功" promptCompletion:^{
                     [self.navigationController popViewControllerAnimated:YES];
                 }];
             }

+ 6 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/GroupNotice/View/GroupNoticeCell.m

@@ -55,7 +55,12 @@
         [self.userLogo sd_setImageWithURL:[NSURL URLWithString:[model.avatar getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:TEACHER_AVATAR]];
         self.noticeContent.text = [NSString returnNoNullStringWithString:model.content];
         if (![NSString isEmptyString:model.content]) {
-            NSMutableAttributedString *attrs = [[NSMutableAttributedString alloc] initWithString:model.content attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular], NSForegroundColorAttributeName:HexRGB(0x777777)}];
+            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+            paragraphStyle.maximumLineHeight = 21;
+            paragraphStyle.minimumLineHeight = 21;
+            UIFont *font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
+            CGFloat baseLineOffset = (21 - font.lineHeight) / 4;
+            NSMutableAttributedString *attrs = [[NSMutableAttributedString alloc] initWithString:model.content attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:font, NSForegroundColorAttributeName:HexRGB(0x777777), NSBaselineOffsetAttributeName:@(baseLineOffset)}];
             self.noticeContent.attributedText = attrs;
         }
         else {

+ 6 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/GroupNotice/View/GroupNoticeDetailBodyView.m

@@ -44,7 +44,12 @@
         
         self.noticeContent.text = [NSString returnNoNullStringWithString:model.content];
         if (![NSString isEmptyString:model.content]) {
-            NSMutableAttributedString *attrs = [[NSMutableAttributedString alloc] initWithString:model.content attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular], NSForegroundColorAttributeName:HexRGB(0x777777)}];
+            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+            paragraphStyle.maximumLineHeight = 21;
+            paragraphStyle.minimumLineHeight = 21;
+            UIFont *font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
+            CGFloat baseLineOffset = (21 - font.lineHeight) / 4;
+            NSMutableAttributedString *attrs = [[NSMutableAttributedString alloc] initWithString:model.content attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:font, NSForegroundColorAttributeName:HexRGB(0x777777), NSBaselineOffsetAttributeName:@(baseLineOffset)}];
             self.noticeContent.attributedText = attrs;
         }
         else {

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/GroupNotice/View/NoticeEditBodyView.m

@@ -51,7 +51,7 @@
             return;
         }
         if ([NSString isEmptyString:self.contentArea.text]) {
-            [LOADING_MANAGER MBShowAUTOHidingInWindow:@"请填写群公告"];
+            [LOADING_MANAGER MBShowAUTOHidingInWindow:@"请输入公告内容"];
             return;
         }
         self.callback();

+ 4 - 13
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/Setting/DeleteAccount/View/KSDeleteFailedAlertView.m

@@ -63,7 +63,7 @@
                     make.top.mas_equalTo(self.layoutView.mas_bottom).offset(8);
                 }
                 make.left.right.mas_equalTo(self.tipsContainer);
-                make.height.mas_equalTo(DEL_LINE_HEIGHT);
+                make.height.mas_equalTo(20);
             }];
             self.layoutView = clientStuTitle;
             
@@ -85,7 +85,7 @@
             paragraphStyle.maximumLineHeight = DEL_LINE_HEIGHT;
             paragraphStyle.minimumLineHeight = DEL_LINE_HEIGHT;
             UIFont *font = [UIFont systemFontOfSize:14.0f];
-            CGFloat baseLineOffset = (DEL_LINE_HEIGHT - font.lineHeight) / 4;
+            CGFloat baseLineOffset = (DEL_LINE_HEIGHT - font.lineHeight) / 2;
             NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:newString attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:font,NSForegroundColorAttributeName:HexRGB(0x666666), NSBaselineOffsetAttributeName:@(baseLineOffset)}];
             
             UILabel *errorTipsLabel = [[UILabel alloc] initWithFrame:CGRectZero];
@@ -115,7 +115,7 @@
                 else {
                     make.top.mas_equalTo(self.layoutView.mas_bottom).offset(8);
                 }
-                make.height.mas_equalTo(DEL_LINE_HEIGHT);
+                make.height.mas_equalTo(20);
             }];
             self.layoutView = clientTeaTitle;
             
@@ -137,7 +137,7 @@
             paragraphStyle.maximumLineHeight = DEL_LINE_HEIGHT;
             paragraphStyle.minimumLineHeight = DEL_LINE_HEIGHT;
             UIFont *font = [UIFont systemFontOfSize:14.0f];
-            CGFloat baseLineOffset = (DEL_LINE_HEIGHT - font.lineHeight) / 4;
+            CGFloat baseLineOffset = (DEL_LINE_HEIGHT - font.lineHeight) / 2;
             NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:newString attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:font,NSForegroundColorAttributeName:HexRGB(0x666666), NSBaselineOffsetAttributeName:@(baseLineOffset)}];
             
             UILabel *errorTipsLabel = [[UILabel alloc] initWithFrame:CGRectZero];
@@ -158,15 +158,6 @@
     [self setNeedsLayout];
 }
 
-- (CGFloat)getLabelHeight:(NSString *)desc {
-    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
-    paragraphStyle.maximumLineHeight = DEL_LINE_HEIGHT;
-    paragraphStyle.minimumLineHeight = DEL_LINE_HEIGHT;
-    UIFont *font = [UIFont systemFontOfSize:14.0f];
-    CGFloat baseLineOffset = (DEL_LINE_HEIGHT - font.lineHeight) / 4;
-    return [desc boundingRectWithSize:CGSizeMake(265, CGFLOAT_MAX) options:(NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:font,NSForegroundColorAttributeName:HexRGB(0x666666), NSBaselineOffsetAttributeName:@(baseLineOffset)} context:nil].size.height + 1;
-}
-
 - (void)layoutSubviews {
     [super layoutSubviews];
     CGFloat contentHeight = CGRectGetMaxY(self.layoutView.frame); // 10是底部留白

+ 5 - 1
KulexiuForTeacher/Pods/TUIChat/TXGroupNoticeMessage.m

@@ -31,8 +31,12 @@
     CGFloat width = ([UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height ? [UIScreen mainScreen].bounds.size.height : [UIScreen mainScreen].bounds.size.width);
 
     if (![self isEmptyString:self.msgContent]) {
+        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+        paragraphStyle.maximumLineHeight = 21;
+        paragraphStyle.minimumLineHeight = 21;
+        UIFont *font = [UIFont systemFontOfSize:16.0f];
         
-        CGFloat height = [self.msgContent boundingRectWithSize:CGSizeMake(225, CGFLOAT_MAX) options:(NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15.0f],NSForegroundColorAttributeName:TXHexRGB(0x333333)} context:nil].size.height + 1;
+        CGFloat height = [self.msgContent boundingRectWithSize:CGSizeMake(221, CGFLOAT_MAX) options:(NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:font,NSForegroundColorAttributeName:TXHexRGB(0x333333)} context:nil].size.height + 1;
         CGFloat contentHeight = height + 64 + 11;
         return CGSizeMake(width, contentHeight);
     }

+ 12 - 8
KulexiuForTeacher/Pods/TUIChat/TXGroupNoticeMessageCell.m

@@ -31,7 +31,7 @@
     [self.noticeContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(self.avatarView.mas_right).offset(10);
         make.top.mas_equalTo(self.avatarView.mas_top);
-        make.width.mas_equalTo(249);
+        make.width.mas_equalTo(245);
         make.bottom.mas_equalTo(self.container.mas_bottom).offset(-10);
     }];
 }
@@ -44,7 +44,7 @@
         [self.noticeContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.left.mas_equalTo(self.avatarView.mas_right).offset(10);
             make.top.mas_equalTo(self.avatarView.mas_top);
-            make.width.mas_equalTo(249);
+            make.width.mas_equalTo(245);
             make.height.mas_equalTo(height);
         }];
     }
@@ -52,7 +52,7 @@
         [self.noticeContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.right.mas_equalTo(self.avatarView.mas_left).offset(-10);
             make.top.mas_equalTo(self.avatarView.mas_top);
-            make.width.mas_equalTo(249);
+            make.width.mas_equalTo(245);
             make.height.mas_equalTo(height);
         }];
     }
@@ -62,9 +62,10 @@
     TXGroupNoticeMessage *noticeMsg = (TXGroupNoticeMessage *)data;
     if (![TXGroupNoticeMessageCell isEmptyString:noticeMsg.msgContent]) {
         NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
-        [paragraphStyle setLineSpacing:4];//调整行间距
-        
-        CGFloat height = [noticeMsg.msgContent boundingRectWithSize:CGSizeMake(225, CGFLOAT_MAX) options:(NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} context:nil].size.height + 1;
+        paragraphStyle.maximumLineHeight = 21;
+        paragraphStyle.minimumLineHeight = 21;
+        UIFont *font = [UIFont systemFontOfSize:16.0f];
+        CGFloat height = [noticeMsg.msgContent boundingRectWithSize:CGSizeMake(221, CGFLOAT_MAX) options:(NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:font} context:nil].size.height + 1;
         CGFloat contentHeight = height + 64 + 11;
         return contentHeight;
     }
@@ -91,8 +92,11 @@
     TXGroupNoticeMessage *noticeMsg = (TXGroupNoticeMessage *)data;
     CGFloat width = ([UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height ? [UIScreen mainScreen].bounds.size.height : [UIScreen mainScreen].bounds.size.width);
     if (![self isEmptyString:noticeMsg.msgContent]) {
-        
-        CGFloat height = [noticeMsg.msgContent boundingRectWithSize:CGSizeMake(225, CGFLOAT_MAX) options:(NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} context:nil].size.height + 6;
+        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+        paragraphStyle.maximumLineHeight = 21;
+        paragraphStyle.minimumLineHeight = 21;
+        UIFont *font = [UIFont systemFontOfSize:16.0f];
+        CGFloat height = [noticeMsg.msgContent boundingRectWithSize:CGSizeMake(221, CGFLOAT_MAX) options:(NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:font,NSParagraphStyleAttributeName:paragraphStyle} context:nil].size.height + 6;
         CGFloat contentHeight = height + 64 + 11;
         return CGSizeMake(width, contentHeight);
     }

+ 10 - 4
KulexiuForTeacher/Pods/TUIChat/TXGroupNoticeMessageContentView.m

@@ -75,7 +75,13 @@
 - (void)configCellWithMsgTitle:(NSString *)title content:(NSString *)content {
     self.msgTitleLabel.text = [self returnNoNullStringWithString:title];
     if (![self isEmptyString:content]) {
-        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:content attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15.0f],NSForegroundColorAttributeName:TXHexRGB(0x333333)}];
+        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+        paragraphStyle.maximumLineHeight = 21;
+        paragraphStyle.minimumLineHeight = 21;
+        UIFont *font = [UIFont systemFontOfSize:16.0f];
+        CGFloat baseLineOffset = (21 - font.lineHeight) / 4;
+        
+        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:content attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:font,NSForegroundColorAttributeName:TXHexRGB(0x333333),NSBaselineOffsetAttributeName:@(baseLineOffset)}];
         self.msgContentLabel.attributedText = attr;
     }
     else {
@@ -117,7 +123,7 @@
     if (!_noticedTopTitle) {
         _noticedTopTitle = [[UILabel alloc] init];
         _noticedTopTitle.textColor = TXHexRGB(0x19B396);
-        _noticedTopTitle.font = [UIFont systemFontOfSize:15.0f weight:UIFontWeightRegular];
+        _noticedTopTitle.font = [UIFont systemFontOfSize:16.0f weight:UIFontWeightRegular];
         _noticedTopTitle.text = @"群公告";
     }
     return _noticedTopTitle;
@@ -127,7 +133,7 @@
     if (!_msgTitleLabel) {
         _msgTitleLabel = [[UILabel alloc] init];
         _msgTitleLabel.textColor = TXHexRGB(0x333333);
-        _msgTitleLabel.font = [UIFont systemFontOfSize:15.0f weight:UIFontWeightSemibold];
+        _msgTitleLabel.font = [UIFont systemFontOfSize:16.0f weight:UIFontWeightSemibold];
     }
     return _msgTitleLabel;
 }
@@ -136,7 +142,7 @@
     if (!_msgContentLabel) {
         _msgContentLabel = [[UILabel alloc] init];
         _msgContentLabel.textColor = TXHexRGB(0x333333);
-        _msgContentLabel.font = [UIFont systemFontOfSize:15.0f weight:UIFontWeightRegular];
+        _msgContentLabel.font = [UIFont systemFontOfSize:16.0f weight:UIFontWeightRegular];
         _msgContentLabel.numberOfLines = 0;
     }
     return _msgContentLabel;