Procházet zdrojové kódy

1.首页顶部UI调整
2.修改首页悬浮按钮大小

Steven před 2 roky
rodič
revize
fde15c79bf

+ 14 - 0
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj

@@ -677,6 +677,7 @@
 		BC7CFFD22817FF6D00CAEB21 /* CardDisplayView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC7CFFD12817FF6D00CAEB21 /* CardDisplayView.xib */; };
 		BC7CFFD5281801A800CAEB21 /* CardBandBodyView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7CFFD4281801A800CAEB21 /* CardBandBodyView.m */; };
 		BC7CFFD7281801B700CAEB21 /* CardBandBodyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC7CFFD6281801B700CAEB21 /* CardBandBodyView.xib */; };
+		BC7E770C2900DD8E00EB37AF /* HomeDragButton.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7E770A2900DD8E00EB37AF /* HomeDragButton.m */; };
 		BC8831002873D26000C702A0 /* LiveVideoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8830FE2873D25F00C702A0 /* LiveVideoModel.m */; };
 		BC8831042873D67C00C702A0 /* LiveVideoCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8831022873D67C00C702A0 /* LiveVideoCollectionViewCell.m */; };
 		BC8831052873D67C00C702A0 /* LiveVideoCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC8831032873D67C00C702A0 /* LiveVideoCollectionViewCell.xib */; };
@@ -2187,6 +2188,8 @@
 		BC7CFFD3281801A800CAEB21 /* CardBandBodyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CardBandBodyView.h; sourceTree = "<group>"; };
 		BC7CFFD4281801A800CAEB21 /* CardBandBodyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CardBandBodyView.m; sourceTree = "<group>"; };
 		BC7CFFD6281801B700CAEB21 /* CardBandBodyView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CardBandBodyView.xib; sourceTree = "<group>"; };
+		BC7E770A2900DD8E00EB37AF /* HomeDragButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeDragButton.m; sourceTree = "<group>"; };
+		BC7E770B2900DD8E00EB37AF /* HomeDragButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeDragButton.h; sourceTree = "<group>"; };
 		BC8830FE2873D25F00C702A0 /* LiveVideoModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LiveVideoModel.m; sourceTree = "<group>"; };
 		BC8830FF2873D25F00C702A0 /* LiveVideoModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiveVideoModel.h; sourceTree = "<group>"; };
 		BC8831012873D67B00C702A0 /* LiveVideoCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LiveVideoCollectionViewCell.h; sourceTree = "<group>"; };
@@ -4004,6 +4007,7 @@
 		277935FD27E32BBF0010E277 /* View */ = {
 			isa = PBXGroup;
 			children = (
+				BC7E77092900DD8E00EB37AF /* HomeDragButton */,
 				BC1263A628FF98C300509E90 /* HomeRecommendMusic */,
 				BC1263A028FF98BB00509E90 /* HomeNewMusic */,
 				BC8B641828F3E8D800A08D16 /* AwardAlert */,
@@ -5557,6 +5561,15 @@
 			path = View;
 			sourceTree = "<group>";
 		};
+		BC7E77092900DD8E00EB37AF /* HomeDragButton */ = {
+			isa = PBXGroup;
+			children = (
+				BC7E770B2900DD8E00EB37AF /* HomeDragButton.h */,
+				BC7E770A2900DD8E00EB37AF /* HomeDragButton.m */,
+			);
+			path = HomeDragButton;
+			sourceTree = "<group>";
+		};
 		BC8B641828F3E8D800A08D16 /* AwardAlert */ = {
 			isa = PBXGroup;
 			children = (
@@ -7651,6 +7664,7 @@
 				2779336027E31CB40010E277 /* UIView+KSExtension.m in Sources */,
 				BC0A22A7284751F80065C1AB /* AccompanyProgressView.m in Sources */,
 				2779321C27E30FC30010E277 /* prodectButton.m in Sources */,
+				BC7E770C2900DD8E00EB37AF /* HomeDragButton.m in Sources */,
 				BCE6A08B27F823A300C97704 /* AccompanyCourseCell.m in Sources */,
 				BCC9F42627F69BD200647449 /* KSWhiteboardView.m in Sources */,
 				BCA193BE282B9866004A585D /* MinePageGroupModel.m in Sources */,

+ 54 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Controller/HomeViewController.m

@@ -57,6 +57,8 @@
 #import "HomeRecommendMusicView.h"
 #import "HomeMusicModel.h"
 
+#import "HomeDragButton.h"
+
 #define BUTTONWIDTH (65)
 #define BUTTONHEIGHT (70)
 @interface HomeViewController ()<SDCycleScrollViewDelegate,UIScrollViewDelegate,UICollectionViewDelegate, UICollectionViewDelegateFlowLayout,UICollectionViewDataSource,TYCyclePagerViewDataSource,TYCyclePagerViewDelegate>
@@ -123,6 +125,10 @@
 
 @property (nonatomic, assign) BOOL isCheck;
 
+@property (nonatomic, strong) HomeMessageModel *buttonModel;
+
+@property (nonatomic, strong) HomeDragButton *suspendButton;
+
 @end
 
 @implementation HomeViewController
@@ -249,6 +255,21 @@
     if (self.isCheck) {
         [self checkShowAwardAlert];
     }
+    
+    // 悬浮按钮
+    if (self.buttonModel) {
+        [self showFloatingWindow];
+    }
+}
+
+
+// 显示悬浮窗
+- (void)showFloatingWindow {
+    if (![self.view.subviews containsObject:self.suspendButton]) {
+        [self.view addSubview:self.suspendButton];
+    }
+    [self.view bringSubviewToFront:self.suspendButton];
+    [self.suspendButton.containerView sd_setImageWithURL:[NSURL URLWithString:[self.buttonModel.coverImage getUrlEndcodeString]]];
 }
 
 - (void)checkShowAwardAlert {
@@ -392,6 +413,13 @@
                 [buttonInfoArray addObject:model];
             }
             self.buttonArray = [NSMutableArray arrayWithArray:buttonInfoArray];
+            
+            // 首页悬浮按钮
+            NSArray *suspensionArray = [result arrayValueForKey:@"suspension"];
+            if (suspensionArray.count) {
+                self.buttonModel = [[HomeMessageModel alloc] initWithDictionary:[suspensionArray firstObject]];
+            }
+            
         }
         else {
             [self MBPShow:MESSAGEKEY];
@@ -1533,6 +1561,32 @@
     }
 }
 
+
+- (HomeDragButton *)suspendButton {
+    if (!_suspendButton) {
+        _suspendButton = [[HomeDragButton alloc] initWithFrame:CGRectMake(KPortraitWidth - HomeDragButtonWidth - 10, KPortraitHeight - kTabBarHeight - HomeDragButtonHeight - 12 , HomeDragButtonWidth, HomeDragButtonHeight)];
+        MJWeakSelf;
+        [_suspendButton clickAction:^{
+            [weakSelf showDragWindowDetail];
+        }];
+    }
+    return _suspendButton;
+}
+
+- (void)showDragWindowDetail {
+    NSString *linkUrl = self.buttonModel.linkUrl;
+    if ([self.buttonModel.linkType isEqualToString:@"OUT"]) {
+        // 外部浏览器打开
+        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:linkUrl] options: @{} completionHandler: nil];
+    }
+    else {
+        if (![NSString isEmptyString:linkUrl]) {
+            KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
+            webCtrl.url = linkUrl;
+            [self.navigationController pushViewController:webCtrl animated:YES];
+        }
+    }
+}
 /*
 #pragma mark - Navigation
 

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Model/HomeMessageModel.h

@@ -38,6 +38,7 @@
 @property (nonatomic, strong) NSString *attribute1;
 @property (nonatomic, strong) NSString *content;
 @property (nonatomic, strong) NSString *attribute2;
+@property (nonatomic, strong) NSString *linkType;
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
 - (instancetype)initWithDictionary:(NSDictionary *)dict;

+ 9 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Model/HomeMessageModel.m

@@ -35,6 +35,7 @@ NSString *const kHomeMessageModelOrder = @"order";
 NSString *const kHomeMessageModelAttribute1 = @"attribute1";
 NSString *const kHomeMessageModelContent = @"content";
 NSString *const kHomeMessageModelAttribute2 = @"attribute2";
+NSString *const kHomeMessageModelLinkType = @"linkType";
 
 
 @interface HomeMessageModel ()
@@ -72,6 +73,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
 @synthesize attribute1 = _attribute1;
 @synthesize content = _content;
 @synthesize attribute2 = _attribute2;
+@synthesize linkType = _linkType;
 
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
@@ -113,6 +115,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
             self.attribute1 = [self objectOrNilForKey:kHomeMessageModelAttribute1 fromDictionary:dict];
             self.content = [self objectOrNilForKey:kHomeMessageModelContent fromDictionary:dict];
             self.attribute2 = [self objectOrNilForKey:kHomeMessageModelAttribute2 fromDictionary:dict];
+        self.linkType = [self objectOrNilForKey:kHomeMessageModelLinkType fromDictionary:dict];
 
     }
     
@@ -150,6 +153,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
     [mutableDict setValue:self.attribute1 forKey:kHomeMessageModelAttribute1];
     [mutableDict setValue:self.content forKey:kHomeMessageModelContent];
     [mutableDict setValue:self.attribute2 forKey:kHomeMessageModelAttribute2];
+    [mutableDict setValue:self.linkType forKey:kHomeMessageModelLinkType];
 
     return [NSDictionary dictionaryWithDictionary:mutableDict];
 }
@@ -204,6 +208,8 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
     self.attribute1 = [aDecoder decodeObjectForKey:kHomeMessageModelAttribute1];
     self.content = [aDecoder decodeObjectForKey:kHomeMessageModelContent];
     self.attribute2 = [aDecoder decodeObjectForKey:kHomeMessageModelAttribute2];
+    self.linkType = [aDecoder decodeObjectForKey:kHomeMessageModelLinkType];
+
     return self;
 }
 
@@ -237,6 +243,8 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
     [aCoder encodeObject:_attribute1 forKey:kHomeMessageModelAttribute1];
     [aCoder encodeObject:_content forKey:kHomeMessageModelContent];
     [aCoder encodeObject:_attribute2 forKey:kHomeMessageModelAttribute2];
+    [aCoder encodeObject:_linkType forKey:kHomeMessageModelLinkType];
+
 }
 
 - (id)copyWithZone:(NSZone *)zone
@@ -272,6 +280,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
         copy.attribute1 = [self.attribute1 copyWithZone:zone];
         copy.content = [self.content copyWithZone:zone];
         copy.attribute2 = [self.attribute2 copyWithZone:zone];
+        copy.linkType = [self.linkType copyWithZone:zone];
     }
     
     return copy;

+ 28 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/View/HomeDragButton/HomeDragButton.h

@@ -0,0 +1,28 @@
+//
+//  HomeDragButton.h
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2022/10/19.
+//
+
+#import <UIKit/UIKit.h>
+
+#define HomeDragButtonWidth (100.0)
+#define HomeDragButtonHeight (100.0)
+#define HomeDragButtonBottomSpace (kTabBarHeight)
+#define HomeDragButtonRightSpace (0)
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef void(^HomeDragButtonDetail)(void);
+
+
+@interface HomeDragButton : UIView
+
+@property (nonatomic, strong) UIImageView *containerView;
+
+- (void)clickAction:(HomeDragButtonDetail)callback;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 213 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/View/HomeDragButton/HomeDragButton.m

@@ -0,0 +1,213 @@
+//
+//  HomeDragButton.m
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2022/10/19.
+//
+
+#import "HomeDragButton.h"
+
+#define WIDTH (self.frame.size.width)
+#define HEIGHT (self.frame.size.height)
+
+@interface HomeDragButton ()<UIGestureRecognizerDelegate>
+
+@property (nonatomic, assign) UIInterfaceOrientation currentOrientation;
+
+@property (nonatomic, copy) HomeDragButtonDetail callback;
+
+@end
+
+@implementation HomeDragButton
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.backgroundColor = [UIColor clearColor];
+        [self addSubview:self.containerView];
+        self.containerView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
+        UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(locationChange:)];
+        pan.delaysTouchesBegan = YES;
+        [self addGestureRecognizer:pan];
+        self.currentOrientation = UIInterfaceOrientationPortrait;
+        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(click:)];
+        [self addGestureRecognizer:tap];
+        tap.delegate = self;
+    }
+    return self;
+}
+
+- (void)clickAction:(HomeDragButtonDetail)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
+
+//点击事件
+-(void)click:(UITapGestureRecognizer*)tapGesture {
+    if (self.callback) {
+        self.callback();
+    }
+}
+
+#define KDEAISellDegreesToRadians(degrees) (degrees * M_PI / 180)
+- (void)statusBarOrientationChange:(NSNotification*)notification{
+    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
+    
+    [self setTransform:[self transformForOrientation:orientation]];
+    self.currentOrientation = orientation;
+    
+    CGFloat screenWidth = KPortraitWidth;
+    CGFloat screenHeight = KPortraitHeight - kTabBarHeight;
+    if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
+        self.frame = CGRectMake(HomeDragButtonHeight+HomeDragButtonBottomSpace, screenWidth - HomeDragButtonWidth , HomeDragButtonWidth, HomeDragButtonHeight);
+    }else{
+        self.frame = CGRectMake(screenWidth - HomeDragButtonWidth, screenHeight - HomeDragButtonHeight - HomeDragButtonBottomSpace , HomeDragButtonWidth, HomeDragButtonHeight);
+    }
+}
+
+- (CGAffineTransform)transformForOrientation:(UIInterfaceOrientation)orientation {
+    
+    switch (orientation) {
+            
+        case UIInterfaceOrientationLandscapeLeft:
+            return CGAffineTransformMakeRotation(-KDEAISellDegreesToRadians(90));
+            
+        case UIInterfaceOrientationLandscapeRight:
+            return CGAffineTransformMakeRotation(KDEAISellDegreesToRadians(90));
+            
+        case UIInterfaceOrientationPortraitUpsideDown:
+            return CGAffineTransformMakeRotation(KDEAISellDegreesToRadians(180));
+            
+        case UIInterfaceOrientationPortrait:
+        default:
+            return CGAffineTransformMakeRotation(KDEAISellDegreesToRadians(0));
+    }
+}
+
+//改变位置
+//横屏之后的坐标系变为左下角坐标系,其中x轴向上,y轴向右,在这样的坐标系中计算即可
+-(void)locationChange:(UIPanGestureRecognizer*)pan {
+    
+    if  (self.currentOrientation == UIInterfaceOrientationLandscapeRight || self.currentOrientation == UIInterfaceOrientationLandscapeLeft) {//如果是横屏
+        [self springToBoundsOnLandscape:pan];
+        
+    } else{ //如果是竖屏
+        [self springToBoundsOnPortrait:pan];
+    }
+}
+
+- (void)springToBoundsOnPortrait:(UIPanGestureRecognizer*)panGesture {
+    CGFloat screenWidth = KPortraitWidth;
+    CGFloat screenHeight = KPortraitHeight - kTabBarHeight;
+    
+    CGPoint panPoint = [panGesture locationInView:[[UIApplication sharedApplication] windows][0]];
+    if(panGesture.state == UIGestureRecognizerStateBegan) {
+        
+    } else if (panGesture.state == UIGestureRecognizerStateChanged) {
+        self.center = CGPointMake(panPoint.x,  panPoint.y);
+    } else if(panGesture.state == UIGestureRecognizerStateEnded || panGesture.state == UIGestureRecognizerStateCancelled) {
+        NSLog(@"ss");
+        if(panPoint.x <= screenWidth/2) {
+            if(panPoint.y >= screenHeight-HEIGHT/2-40 ) { //左下边界判断
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(WIDTH/2, screenHeight-HEIGHT/2);
+                }];
+                
+            } else if (panPoint.y < (HEIGHT/2 + STATUS_BAR_HEIGHT)) {
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(WIDTH/2, HEIGHT/2 + STATUS_BAR_HEIGHT);
+                    
+                }];
+            } else {
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(WIDTH/2, panPoint.y);
+                }];
+            }
+        }
+        else if(panPoint.x > screenWidth/2) {
+            if(panPoint.y <= (HEIGHT/2 + STATUS_BAR_HEIGHT)) {//向右越过上边界
+                
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(screenWidth-WIDTH/2, HEIGHT/2 + STATUS_BAR_HEIGHT);
+                }];
+                
+            }
+            else if (panPoint.y > screenHeight-HEIGHT/2) { //右下边界
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(screenWidth-WIDTH/2, screenHeight-HEIGHT/2);
+                }];
+                
+            }else { //正常拖动
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(screenWidth-WIDTH/2, panPoint.y);
+                }];
+            }
+        }
+    }
+}
+
+- (void)springToBoundsOnLandscape:(UIPanGestureRecognizer*)panGesture {
+    CGFloat screenWidth = KPortraitWidth;
+    CGFloat screenHeight = KPortraitHeight - kTabBarHeight;
+    
+    CGPoint panPoint = [panGesture locationInView:[[UIApplication sharedApplication] windows][0]];
+    panPoint = CGPointMake(screenHeight - panPoint.y, panPoint.x);
+    
+    NSLog(@"screenWidth:%f, panPoint:%@", screenWidth, NSStringFromCGPoint(panPoint));
+    
+    if(panGesture.state == UIGestureRecognizerStateBegan) {
+    } else if (panGesture.state == UIGestureRecognizerStateChanged) {
+        self.center = CGPointMake(panPoint.x,  panPoint.y);
+    } else if(panGesture.state == UIGestureRecognizerStateEnded || panGesture.state == UIGestureRecognizerStateCancelled) {
+        if(panPoint.y <= screenWidth/2) {
+            if (panPoint.x <= HEIGHT/2 + STATUS_BAR_HEIGHT) {
+                [UIView animateWithDuration:0.2 animations:^{//左下角
+                    self.center = CGPointMake(WIDTH/2, HEIGHT/2 + STATUS_BAR_HEIGHT);
+                }];
+            }else if (panPoint.x >= screenHeight - HEIGHT/2){//左上角
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(screenHeight - HEIGHT/2, HEIGHT/2 + STATUS_BAR_HEIGHT);
+                }];
+            }else{
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(panPoint.x, HEIGHT/2 + STATUS_BAR_HEIGHT);
+                }];
+            }
+        }
+        else if(panPoint.y > screenWidth/2)
+        {
+            if (panPoint.x <= HEIGHT/2) {//右下角
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(HEIGHT/2,  screenWidth - WIDTH/2);
+                }];
+            }else if (panPoint.x >= screenHeight - HEIGHT/2){//右上角
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(screenHeight - HEIGHT/2, screenWidth - WIDTH/2);
+                }];
+            }else{
+                [UIView animateWithDuration:0.2 animations:^{
+                    self.center = CGPointMake(panPoint.x , screenWidth - WIDTH/2);
+                }];
+            }
+        }
+    }
+}
+
+- (UIImageView *)containerView {
+    if (!_containerView) {
+        _containerView = [[UIImageView alloc] init];
+        _containerView.backgroundColor = [UIColor clearColor];
+        _containerView.contentMode = UIViewContentModeScaleAspectFill;
+    }
+    return _containerView;
+}
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 5 - 5
KulexiuForTeacher/KulexiuForTeacher/Module/Home/View/HomeNavView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -69,13 +69,13 @@
                             </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="xSC-vm-098">
-                            <rect key="frame" x="25" y="8" width="45" height="26.5"/>
+                            <rect key="frame" x="14" y="8" width="45" height="26.5"/>
                             <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="22"/>
                             <color key="textColor" red="0.1019607843" green="0.1019607843" blue="0.1019607843" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
                         <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mine_nomal" translatesAutoresizingMaskIntoConstraints="NO" id="030-NP-gEA">
-                            <rect key="frame" x="76" y="14" width="34" height="15"/>
+                            <rect key="frame" x="65" y="14" width="34" height="15"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="15" id="8P2-Ec-bnf"/>
                                 <constraint firstAttribute="width" constant="34" id="PEK-n6-pcq"/>
@@ -95,7 +95,7 @@
                         <constraint firstItem="030-NP-gEA" firstAttribute="leading" secondItem="xSC-vm-098" secondAttribute="trailing" constant="6" id="X56-N6-R6Q"/>
                         <constraint firstAttribute="height" constant="44" id="cj7-26-Plu"/>
                         <constraint firstItem="qSz-FE-UVP" firstAttribute="top" secondItem="vOh-9c-b3r" secondAttribute="top" id="dgb-Bb-S6e"/>
-                        <constraint firstItem="xSC-vm-098" firstAttribute="leading" secondItem="vOh-9c-b3r" secondAttribute="leading" constant="25" id="twJ-Hw-Msg"/>
+                        <constraint firstItem="xSC-vm-098" firstAttribute="leading" secondItem="vOh-9c-b3r" secondAttribute="leading" constant="14" id="twJ-Hw-Msg"/>
                     </constraints>
                 </view>
             </subviews>

+ 9 - 9
KulexiuForTeacher/KulexiuForTeacher/Module/Home/View/HomeNewHeadView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -14,7 +14,7 @@
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="G60-Et-o3r">
-                    <rect key="frame" x="25" y="38" width="114" height="23"/>
+                    <rect key="frame" x="14" y="38" width="114" height="23"/>
                     <subviews>
                         <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mineStyle_nomal" translatesAutoresizingMaskIntoConstraints="NO" id="Cdf-rH-nsz">
                             <rect key="frame" x="0.0" y="0.0" width="23" height="23"/>
@@ -58,13 +58,13 @@
                     </connections>
                 </view>
                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="勋章" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sUP-ZP-Dxs">
-                    <rect key="frame" x="146" y="41" width="29" height="17"/>
+                    <rect key="frame" x="135" y="41" width="29" height="17"/>
                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                     <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
                     <nil key="highlightedColor"/>
                 </label>
                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0/4" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GIJ-nK-Ul6">
-                    <rect key="frame" x="181" y="41" width="23" height="17"/>
+                    <rect key="frame" x="170" y="41" width="23" height="17"/>
                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                     <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
                     <nil key="highlightedColor"/>
@@ -133,13 +133,13 @@
                     </constraints>
                 </view>
                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="评分:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nDP-6c-WeM">
-                    <rect key="frame" x="25" y="2" width="37" height="15"/>
+                    <rect key="frame" x="14" y="2" width="37" height="15"/>
                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
                     <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
                     <nil key="highlightedColor"/>
                 </label>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Eh7-SW-rWW">
-                    <rect key="frame" x="62" y="0.0" width="95" height="19"/>
+                    <rect key="frame" x="51" y="0.0" width="95" height="19"/>
                     <subviews>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PmF-Mq-0JT" customClass="KSStarView">
                             <rect key="frame" x="0.0" y="0.0" width="95" height="19"/>
@@ -198,8 +198,8 @@
                 <constraint firstItem="Eh7-SW-rWW" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="Rpf-oZ-a5A"/>
                 <constraint firstItem="qdW-5e-X9f" firstAttribute="trailing" secondItem="Jce-l2-nVi" secondAttribute="trailing" id="Xgz-oO-3SI"/>
                 <constraint firstItem="Eh7-SW-rWW" firstAttribute="centerY" secondItem="nDP-6c-WeM" secondAttribute="centerY" id="YbM-aK-3Wu"/>
-                <constraint firstItem="nDP-6c-WeM" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="25" id="ZKO-9F-z81"/>
-                <constraint firstItem="G60-Et-o3r" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="25" id="oxP-IZ-oSI"/>
+                <constraint firstItem="nDP-6c-WeM" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="14" id="ZKO-9F-z81"/>
+                <constraint firstItem="G60-Et-o3r" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="14" id="oxP-IZ-oSI"/>
                 <constraint firstItem="sUP-ZP-Dxs" firstAttribute="leading" secondItem="G60-Et-o3r" secondAttribute="trailing" constant="7" id="qQb-Mw-aPM"/>
                 <constraint firstItem="GIJ-nK-Ul6" firstAttribute="leading" secondItem="sUP-ZP-Dxs" secondAttribute="trailing" constant="6" id="uPv-rF-rzz"/>
                 <constraint firstItem="K9c-3E-YUK" firstAttribute="bottom" secondItem="Jce-l2-nVi" secondAttribute="top" constant="5" id="y8F-1z-mAK"/>