Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
红
红星美凯龙管理在线APP IOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
红星美凯龙管理在线APP IOS
Commits
3a46e680
Commit
3a46e680
authored
Oct 30, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登陆 首页界面插入图片
parent
b46c9a19
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
265 additions
and
117 deletions
+265
-117
project.pbxproj
redstar.xcodeproj/project.pbxproj
+6
-0
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Login_password.png
...xcassets/Login/Login_password.imageset/Login_password.png
+0
-0
Contents.json
...ssets.xcassets/Login/password_icon.imageset/Contents.json
+22
-0
password_icon@2x.png
...cassets/Login/password_icon.imageset/password_icon@2x.png
+0
-0
password_icon@3x.png
...cassets/Login/password_icon.imageset/password_icon@3x.png
+0
-0
Contents.json
...ssets.xcassets/Login/username_icon.imageset/Contents.json
+22
-0
username_icon@2x.png
...cassets/Login/username_icon.imageset/username_icon@2x.png
+0
-0
username_icon@3x.png
...cassets/Login/username_icon.imageset/username_icon@3x.png
+0
-0
Contents.json
...r/Assets.xcassets/home/arrow_right.imageset/Contents.json
+2
-1
arrow_right@2x.png
...ets.xcassets/home/arrow_right.imageset/arrow_right@2x.png
+0
-0
arrow_right@3x.png
...ets.xcassets/home/arrow_right.imageset/arrow_right@3x.png
+0
-0
Constant.h
redstar/Classes/Macro/Constant.h
+9
-1
HomeCellItem.h
redstar/Classes/Module/Home/Cell/HomeCellItem.h
+13
-0
HomeCellItem.m
redstar/Classes/Module/Home/Cell/HomeCellItem.m
+48
-0
HomeFunctionCell.h
redstar/Classes/Module/Home/Cell/HomeFunctionCell.h
+7
-6
HomeFunctionCell.m
redstar/Classes/Module/Home/Cell/HomeFunctionCell.m
+100
-79
NewAnnounceCell.m
redstar/Classes/Module/Home/Cell/NewAnnounceCell.m
+11
-5
HomeHeaderView.m
redstar/Classes/Module/Home/View/HomeHeaderView.m
+4
-2
HomeViewController.m
...r/Classes/Module/Home/ViewController/HomeViewController.m
+11
-12
LoginView.m
redstar/Classes/Module/Login/View/LoginView.m
+9
-8
LoginViewController.m
...Classes/Module/Login/ViewController/LoginViewController.m
+1
-3
No files found.
redstar.xcodeproj/project.pbxproj
View file @
3a46e680
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
840ABECC1BE1C29F006E49C5
/* RankDetailViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
840ABECB1BE1C29F006E49C5
/* RankDetailViewController.m */
;
};
840ABECC1BE1C29F006E49C5
/* RankDetailViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
840ABECB1BE1C29F006E49C5
/* RankDetailViewController.m */
;
};
840ABECF1BE20A53006E49C5
/* RankShopDetialCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
840ABECE1BE20A53006E49C5
/* RankShopDetialCell.m */
;
};
840ABECF1BE20A53006E49C5
/* RankShopDetialCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
840ABECE1BE20A53006E49C5
/* RankShopDetialCell.m */
;
};
8442BA5C1BDB8FDB005E5657
/* MineTableHeaderView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8442BA5B1BDB8FDB005E5657
/* MineTableHeaderView.m */
;
};
8442BA5C1BDB8FDB005E5657
/* MineTableHeaderView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8442BA5B1BDB8FDB005E5657
/* MineTableHeaderView.m */
;
};
8474A01C1BE368D700315F30
/* HomeCellItem.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8474A01B1BE368D700315F30
/* HomeCellItem.m */
;
};
84846E971BE069BC0010550A
/* DateButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84846E961BE069BC0010550A
/* DateButton.m */
;
};
84846E971BE069BC0010550A
/* DateButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84846E961BE069BC0010550A
/* DateButton.m */
;
};
84846E9A1BE07CDF0010550A
/* RankingListCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84846E991BE07CDF0010550A
/* RankingListCell.m */
;
};
84846E9A1BE07CDF0010550A
/* RankingListCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84846E991BE07CDF0010550A
/* RankingListCell.m */
;
};
848699B01BDF810900859DFE
/* InspectListCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8486999F1BDF810900859DFE
/* InspectListCell.m */
;
};
848699B01BDF810900859DFE
/* InspectListCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8486999F1BDF810900859DFE
/* InspectListCell.m */
;
};
...
@@ -67,6 +68,8 @@
...
@@ -67,6 +68,8 @@
840ABECE1BE20A53006E49C5
/* RankShopDetialCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
RankShopDetialCell.m
;
sourceTree
=
"<group>"
;
};
840ABECE1BE20A53006E49C5
/* RankShopDetialCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
RankShopDetialCell.m
;
sourceTree
=
"<group>"
;
};
8442BA5A1BDB8FDB005E5657
/* MineTableHeaderView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
MineTableHeaderView.h
;
sourceTree
=
"<group>"
;
};
8442BA5A1BDB8FDB005E5657
/* MineTableHeaderView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
MineTableHeaderView.h
;
sourceTree
=
"<group>"
;
};
8442BA5B1BDB8FDB005E5657
/* MineTableHeaderView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
MineTableHeaderView.m
;
sourceTree
=
"<group>"
;
};
8442BA5B1BDB8FDB005E5657
/* MineTableHeaderView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
MineTableHeaderView.m
;
sourceTree
=
"<group>"
;
};
8474A01A1BE368D700315F30
/* HomeCellItem.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
HomeCellItem.h
;
sourceTree
=
"<group>"
;
};
8474A01B1BE368D700315F30
/* HomeCellItem.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
HomeCellItem.m
;
sourceTree
=
"<group>"
;
};
84846E951BE069BC0010550A
/* DateButton.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
DateButton.h
;
sourceTree
=
"<group>"
;
};
84846E951BE069BC0010550A
/* DateButton.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
DateButton.h
;
sourceTree
=
"<group>"
;
};
84846E961BE069BC0010550A
/* DateButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
DateButton.m
;
sourceTree
=
"<group>"
;
};
84846E961BE069BC0010550A
/* DateButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
DateButton.m
;
sourceTree
=
"<group>"
;
};
84846E981BE07CDF0010550A
/* RankingListCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
RankingListCell.h
;
sourceTree
=
"<group>"
;
};
84846E981BE07CDF0010550A
/* RankingListCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
RankingListCell.h
;
sourceTree
=
"<group>"
;
};
...
@@ -580,6 +583,8 @@
...
@@ -580,6 +583,8 @@
84C582EB1BDDFB0400AF838D
/* HomeFunctionCell.m */
,
84C582EB1BDDFB0400AF838D
/* HomeFunctionCell.m */
,
84DB060F1BE33F33003E581E
/* NewAnnounceCell.h */
,
84DB060F1BE33F33003E581E
/* NewAnnounceCell.h */
,
84DB06101BE33F33003E581E
/* NewAnnounceCell.m */
,
84DB06101BE33F33003E581E
/* NewAnnounceCell.m */
,
8474A01A1BE368D700315F30
/* HomeCellItem.h */
,
8474A01B1BE368D700315F30
/* HomeCellItem.m */
,
);
);
path
=
Cell
;
path
=
Cell
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -903,6 +908,7 @@
...
@@ -903,6 +908,7 @@
848699B01BDF810900859DFE
/* InspectListCell.m in Sources */
,
848699B01BDF810900859DFE
/* InspectListCell.m in Sources */
,
84FD8A071BDA01C4006E442A
/* ChartViewController.m in Sources */
,
84FD8A071BDA01C4006E442A
/* ChartViewController.m in Sources */
,
84970DEF1BD8DD8A00C1728A
/* main.m in Sources */
,
84970DEF1BD8DD8A00C1728A
/* main.m in Sources */
,
8474A01C1BE368D700315F30
/* HomeCellItem.m in Sources */
,
84D8257F1BDD2F7E00CC61F7
/* MineTableFooterView.m in Sources */
,
84D8257F1BDD2F7E00CC61F7
/* MineTableFooterView.m in Sources */
,
84970E281BD8DEFE00C1728A
/* AppDelegate.m in Sources */
,
84970E281BD8DEFE00C1728A
/* AppDelegate.m in Sources */
,
848699B31BDF810900859DFE
/* InspectTaskViewController.m in Sources */
,
848699B31BDF810900859DFE
/* InspectTaskViewController.m in Sources */
,
...
...
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
3a46e680
No preview for this file type
redstar/Assets.xcassets/Login/Login_password.imageset/Login_password.png
deleted
100644 → 0
View file @
b46c9a19
1.02 KB
redstar/Assets.xcassets/Login/password_icon.imageset/Contents.json
0 → 100644
View file @
3a46e680
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"password_icon@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"password_icon@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
redstar/Assets.xcassets/Login/password_icon.imageset/password_icon@2x.png
0 → 100644
View file @
3a46e680
1.38 KB
redstar/Assets.xcassets/Login/password_icon.imageset/password_icon@3x.png
0 → 100644
View file @
3a46e680
1.62 KB
redstar/Assets.xcassets/Login/username_icon.imageset/Contents.json
0 → 100644
View file @
3a46e680
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"username_icon@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"username_icon@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
redstar/Assets.xcassets/Login/username_icon.imageset/username_icon@2x.png
0 → 100644
View file @
3a46e680
1.87 KB
redstar/Assets.xcassets/Login/username_icon.imageset/username_icon@3x.png
0 → 100644
View file @
3a46e680
2.39 KB
redstar/Assets.xcassets/
Login/Login_password
.imageset/Contents.json
→
redstar/Assets.xcassets/
home/arrow_right
.imageset/Contents.json
View file @
3a46e680
...
@@ -2,15 +2,16 @@
...
@@ -2,15 +2,16 @@
"images"
:
[
"images"
:
[
{
{
"idiom"
:
"universal"
,
"idiom"
:
"universal"
,
"filename"
:
"Login_password.png"
,
"scale"
:
"1x"
"scale"
:
"1x"
},
},
{
{
"idiom"
:
"universal"
,
"idiom"
:
"universal"
,
"filename"
:
"arrow_right@2x.png"
,
"scale"
:
"2x"
"scale"
:
"2x"
},
},
{
{
"idiom"
:
"universal"
,
"idiom"
:
"universal"
,
"filename"
:
"arrow_right@3x.png"
,
"scale"
:
"3x"
"scale"
:
"3x"
}
}
],
],
...
...
redstar/Assets.xcassets/home/arrow_right.imageset/arrow_right@2x.png
0 → 100644
View file @
3a46e680
1.22 KB
redstar/Assets.xcassets/home/arrow_right.imageset/arrow_right@3x.png
0 → 100644
View file @
3a46e680
1.42 KB
redstar/Classes/Macro/Constant.h
View file @
3a46e680
...
@@ -36,7 +36,15 @@
...
@@ -36,7 +36,15 @@
#define kSectionBackGroundColor [UIColor colorWithRed:246 / 255.0 green:246 / 255.0 blue:246 / 255.0 alpha:1.0]
#define kSectionBackGroundColor [UIColor colorWithRed:246 / 255.0 green:246 / 255.0 blue:246 / 255.0 alpha:1.0]
// #999999
// #999999
#define kHomeSectionTitleTextColor [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1.0]
#define kHomeSectionTitleTextColor [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1.0]
// #444444
#define kAnnounceTextColor [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
// #adadad
#define kPointColor [UIColor colorWithRed:173 / 255.0 green:173 / 255.0 blue:173 / 255.0 alpha:1.0]
// #cccccc
#define kSeparateLineViewColor [UIColor colorWithRed:204 / 255.0 green:204 / 255.0 blue:204 / 255.0 alpha:1.0]
#define kLineCGColor [[UIColor colorWithRed:209 / 255.0 green:209 / 255.0 blue:209 / 255.0 alpha:1.0] CGColor]
// #666666
#define kHomeItemTextColor [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1.0]
#import "UIView+Extension.h"
#import "UIView+Extension.h"
...
...
redstar/Classes/Module/Home/Cell/HomeCellItem.h
0 → 100644
View file @
3a46e680
//
// HomeCellItem.h
// redstar
//
// Created by admin on 15/10/30.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
HomeCellItem
:
UIButton
@end
redstar/Classes/Module/Home/Cell/HomeCellItem.m
0 → 100644
View file @
3a46e680
//
// HomeCellItem.m
// redstar
//
// Created by admin on 15/10/30.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "HomeCellItem.h"
@implementation
HomeCellItem
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
if
(
self
=
[
super
initWithFrame
:
frame
])
{
self
.
imageView
.
contentMode
=
UIViewContentModeCenter
;
[
self
setTitleColor
:
kHomeItemTextColor
forState
:
UIControlStateNormal
];
self
.
titleLabel
.
textAlignment
=
NSTextAlignmentCenter
;
self
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
];
[
self
setTitleColor
:[
UIColor
blackColor
]
forState
:
UIControlStateNormal
];
[
self
setTitleColor
:[
UIColor
orangeColor
]
forState
:
UIControlStateSelected
];
self
.
layer
.
borderWidth
=
0
.
5
;
self
.
layer
.
borderColor
=
kLineCGColor
;
}
return
self
;
}
-
(
void
)
layoutSubviews
{
[
super
layoutSubviews
];
CGFloat
btnW
=
self
.
width
;
CGFloat
btnH
=
self
.
height
;
CGFloat
imageH
=
btnH
*
0
.
7
;
self
.
imageView
.
frame
=
CGRectMake
(
0
,
7
,
btnW
,
imageH
);
CGFloat
titleH
=
btnH
-
imageH
;
CGFloat
titleY
=
imageH
-
5
;
self
.
titleLabel
.
frame
=
CGRectMake
(
0
,
titleY
,
btnW
,
titleH
);
// // 设置badgeView尺寸
// self.badgeView.x = self.width - self.badgeView.width - HMMargin;
//
// self.badgeView.y = 0;
}
@end
redstar/Classes/Module/Home/Cell/HomeFunctionCell.h
View file @
3a46e680
...
@@ -7,14 +7,15 @@
...
@@ -7,14 +7,15 @@
//
//
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import "HomeCellItem.h"
@interface
HomeFunctionCell
:
UITableViewCell
@interface
HomeFunctionCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UIButton
*
onLineSamplingBtn
;
// 在线抽查按钮
@property
(
nonatomic
,
strong
)
HomeCellItem
*
onLineSamplingBtn
;
// 在线抽查按钮
@property
(
nonatomic
,
strong
)
UIButton
*
wordOfMouthBtn
;
// 口碑按钮
@property
(
nonatomic
,
strong
)
HomeCellItem
*
wordOfMouthBtn
;
// 口碑按钮
@property
(
nonatomic
,
strong
)
UIButton
*
standardBtn
;
// 口碑标准按钮
@property
(
nonatomic
,
strong
)
HomeCellItem
*
standardBtn
;
// 口碑标准按钮
@property
(
nonatomic
,
strong
)
UIButton
*
pictureBtn
;
// 图说口碑按钮
@property
(
nonatomic
,
strong
)
HomeCellItem
*
pictureBtn
;
// 图说口碑按钮
@property
(
nonatomic
,
strong
)
UIButton
*
questionBtn
;
// 问题与知识按钮
@property
(
nonatomic
,
strong
)
HomeCellItem
*
questionBtn
;
// 问题与知识按钮
@property
(
nonatomic
,
strong
)
UIButton
*
caseBtn
;
// 优秀案例按钮
@property
(
nonatomic
,
strong
)
HomeCellItem
*
caseBtn
;
// 优秀案例按钮
@end
@end
redstar/Classes/Module/Home/Cell/HomeFunctionCell.m
View file @
3a46e680
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
#import "HomeFunctionCell.h"
#import "HomeFunctionCell.h"
@interface
HomeFunctionCell
()
@property
(
nonatomic
,
strong
)
UIView
*
lineView
;
@end
@implementation
HomeFunctionCell
@implementation
HomeFunctionCell
#pragma mark - System Methods
#pragma mark - System Methods
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
...
@@ -33,35 +37,37 @@
...
@@ -33,35 +37,37 @@
{
{
[
self
.
onLineSamplingBtn
setTitle
:
@"在线抽查"
forState
:
UIControlStateNormal
];
[
self
.
onLineSamplingBtn
setTitle
:
@"在线抽查"
forState
:
UIControlStateNormal
];
[
self
.
wordOfMouthBtn
setTitle
:
@"口碑报告"
forState
:
UIControlStateNormal
];
[
self
.
wordOfMouthBtn
setTitle
:
@"口碑报告"
forState
:
UIControlStateNormal
];
[
self
.
questionBtn
setTitle
:
@"问题与知识"
forState
:
UIControlStateNormal
];
[
self
.
standardBtn
setTitle
:
@"口碑标准"
forState
:
UIControlStateNormal
];
[
self
.
standardBtn
setTitle
:
@"口碑标准"
forState
:
UIControlStateNormal
];
[
self
.
pictureBtn
setTitle
:
@"图说口碑"
forState
:
UIControlStateNormal
];
[
self
.
pictureBtn
setTitle
:
@"图说口碑"
forState
:
UIControlStateNormal
];
[
self
.
questionBtn
setTitle
:
@"问题与知识"
forState
:
UIControlStateNormal
];
[
self
.
caseBtn
setTitle
:
@"优秀案例"
forState
:
UIControlStateNormal
];
[
self
.
caseBtn
setTitle
:
@"优秀案例"
forState
:
UIControlStateNormal
];
self
.
lineView
.
backgroundColor
=
kSeparateLineViewColor
;
}
}
#pragma mark - lazy loading
#pragma mark - lazy loading
-
(
UIButton
*
)
onLineSamplingBtn
-
(
HomeCellItem
*
)
onLineSamplingBtn
{
{
if
(
!
_onLineSamplingBtn
)
{
if
(
!
_onLineSamplingBtn
)
{
_onLineSamplingBtn
=
[[
UIButton
alloc
]
init
];
_onLineSamplingBtn
=
[[
HomeCellItem
alloc
]
init
];
_onLineSamplingBtn
.
backgroundColor
=
[
UIColor
redColor
];
_onLineSamplingBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_onLineSamplingBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_onLineSamplingBtn
];
[
_onLineSamplingBtn
setImage
:[
UIImage
imageNamed
:
@"task_online"
]
forState
:
UIControlStateNormal
];
[
self
.
contentView
addSubview
:
_onLineSamplingBtn
];
NSLayoutConstraint
*
onLineSamplingTop
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
onLineSamplingTop
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
onLineSamplingTop
];
[
self
.
contentView
addConstraint
:
onLineSamplingTop
];
NSLayoutConstraint
*
onLineSamplingLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
onLineSamplingLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
onLineSamplingLeft
];
[
self
.
contentView
addConstraint
:
onLineSamplingLeft
];
NSLayoutConstraint
*
onLineSamplingWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
wordOfMouthBtn
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
onLineSamplingWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
wordOfMouthBtn
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
onLineSamplingWidth
];
[
self
.
contentView
addConstraint
:
onLineSamplingWidth
];
NSLayoutConstraint
*
onLineSamplingRight
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
wordOfMouthBtn
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
onLineSamplingRight
];
NSLayoutConstraint
*
onLineSamplingHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
standardBtn
attribute
:
NSLayoutAttributeHeight
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
onLineSamplingHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
119
];
[
self
addConstraint
:
onLineSamplingHeight
];
[
self
.
contentView
addConstraint
:
onLineSamplingHeight
];
...
@@ -69,135 +75,150 @@
...
@@ -69,135 +75,150 @@
return
_onLineSamplingBtn
;
return
_onLineSamplingBtn
;
}
}
-
(
UIButton
*
)
wordOfMouthBtn
-
(
HomeCellItem
*
)
wordOfMouthBtn
{
{
if
(
!
_wordOfMouthBtn
)
{
if
(
!
_wordOfMouthBtn
)
{
_wordOfMouthBtn
=
[[
UIButton
alloc
]
init
];
_wordOfMouthBtn
=
[[
HomeCellItem
alloc
]
init
];
_wordOfMouthBtn
.
backgroundColor
=
[
UIColor
brownColor
];
[
_wordOfMouthBtn
setImage
:[
UIImage
imageNamed
:
@"praise_report"
]
forState
:
UIControlStateNormal
];
_wordOfMouthBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_wordOfMouthBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_wordOfMouthBtn
];
[
self
.
contentView
addSubview
:
_wordOfMouthBtn
];
NSLayoutConstraint
*
wordOfMouthTop
=
[
NSLayoutConstraint
constraintWithItem
:
_wordOfMouthBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
wordOfMouthTop
=
[
NSLayoutConstraint
constraintWithItem
:
_wordOfMouthBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
wordOfMouthTop
];
[
self
.
contentView
addConstraint
:
wordOfMouthTop
];
NSLayoutConstraint
*
wordOfMouthRight
=
[
NSLayoutConstraint
constraintWithItem
:
_wordOfMouthBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRigh
t
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
wordOfMouthRight
=
[
NSLayoutConstraint
constraintWithItem
:
_wordOfMouthBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
standardBtn
attribute
:
NSLayoutAttributeLef
t
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
wordOfMouthRight
];
[
self
.
contentView
addConstraint
:
wordOfMouthRight
];
NSLayoutConstraint
*
wordOfMouth
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_wordOfMouthBtn
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
wordOfMouth
Withd
=
[
NSLayoutConstraint
constraintWithItem
:
_wordOfMouthBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
standardBtn
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
wordOfMouthLeft
];
[
self
.
contentView
addConstraint
:
wordOfMouthWithd
];
NSLayoutConstraint
*
wordOfMouthHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_wordOfMouthBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
8
0
];
NSLayoutConstraint
*
wordOfMouthHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_wordOfMouthBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeHeight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
wordOfMouthHeight
];
[
self
.
contentView
addConstraint
:
wordOfMouthHeight
];
}
}
return
_wordOfMouthBtn
;
return
_wordOfMouthBtn
;
}
}
-
(
UIButton
*
)
standardBtn
-
(
HomeCellItem
*
)
standardBtn
{
{
if
(
!
_standardBtn
)
{
if
(
!
_standardBtn
)
{
_standardBtn
=
[[
UIButton
alloc
]
init
];
_standardBtn
=
[[
HomeCellItem
alloc
]
init
];
_standardBtn
.
backgroundColor
=
[
UIColor
blueColor
];
[
_standardBtn
setImage
:[
UIImage
imageNamed
:
@"praise_standard"
]
forState
:
UIControlStateNormal
];
_standardBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_standardBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_standardBtn
];
[
self
.
contentView
addSubview
:
_standardBtn
];
NSLayoutConstraint
*
standardLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_standardBtn
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
standardLeft
];
NSLayoutConstraint
*
standardRight
=
[
NSLayoutConstraint
constraintWithItem
:
_standardBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
standardRight
];
NSLayoutConstraint
*
standardWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_standardBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
pictureBtn
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
standardWidth
];
NSLayoutConstraint
*
standardHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_standardBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
_wordOfMouthBtn
attribute
:
NSLayoutAttributeHeight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
standardHeight
];
NSLayoutConstraint
*
standardTop
=
[
NSLayoutConstraint
constraintWithItem
:
_standardBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
onLineSamplingBtn
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
standardTop
];
NSLayoutConstraint
*
standard
Bottom
=
[
NSLayoutConstraint
constraintWithItem
:
_standardBtn
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
questionBtn
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
standard
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_standardBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
standardBottom
];
[
self
.
contentView
addConstraint
:
standardTop
];
}
}
return
_standardBtn
;
return
_standardBtn
;
}
}
-
(
UIButton
*
)
pictureBtn
-
(
HomeCellItem
*
)
pictureBtn
{
{
if
(
!
_pictureBtn
)
{
if
(
!
_pictureBtn
)
{
_pictureBtn
=
[[
UIButton
alloc
]
init
];
_pictureBtn
=
[[
HomeCellItem
alloc
]
init
];
_pictureBtn
.
backgroundColor
=
[
UIColor
grayColor
];
[
_pictureBtn
setImage
:[
UIImage
imageNamed
:
@"praise_image"
]
forState
:
UIControlStateNormal
];
_pictureBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_pictureBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_pictureBtn
];
[
self
.
contentView
addSubview
:
_pictureBtn
];
NSLayoutConstraint
*
pictureLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_pictureBtn
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
_standardBtn
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
pictureTop
=
[
NSLayoutConstraint
constraintWithItem
:
_pictureBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
onLineSamplingBtn
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
pictureLeft
];
[
self
.
contentView
addConstraint
:
pictureTop
];
NSLayoutConstraint
*
pictureLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_pictureBtn
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
pictureLeft
];
NSLayoutConstraint
*
pictureRight
=
[
NSLayoutConstraint
constraintWithItem
:
_pictureBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRigh
t
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
pictureRight
=
[
NSLayoutConstraint
constraintWithItem
:
_pictureBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
questionBtn
attribute
:
NSLayoutAttributeLef
t
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
pictureRight
];
[
self
.
contentView
addConstraint
:
pictureRight
];
NSLayoutConstraint
*
picture
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_pictureBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
wordOfMouthBtn
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
picture
Width
=
[
NSLayoutConstraint
constraintWithItem
:
_pictureBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
questionBtn
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
pictureTop
];
[
self
.
contentView
addConstraint
:
pictureWidth
];
NSLayoutConstraint
*
picture
Bottom
=
[
NSLayoutConstraint
constraintWithItem
:
_pictureBtn
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
caseBtn
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
picture
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_pictureBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
onLineSamplingBtn
attribute
:
NSLayoutAttributeHeight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
pictureBottom
];
[
self
.
contentView
addConstraint
:
pictureHeight
];
}
}
return
_pictureBtn
;
return
_pictureBtn
;
}
}
-
(
UIButton
*
)
questionBtn
-
(
HomeCellItem
*
)
questionBtn
{
{
if
(
!
_questionBtn
)
{
if
(
!
_questionBtn
)
{
_questionBtn
=
[[
UIButton
alloc
]
init
];
_questionBtn
=
[[
HomeCellItem
alloc
]
init
];
_questionBtn
.
backgroundColor
=
[
UIColor
blackColor
];
[
_questionBtn
setImage
:[
UIImage
imageNamed
:
@"question_problem"
]
forState
:
UIControlStateNormal
];
_questionBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_questionBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_questionBtn
];
[
self
.
contentView
addSubview
:
_questionBtn
];
NSLayoutConstraint
*
questionWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_questionBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
_
caseBtn
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
questionWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_questionBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
caseBtn
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
questionWidth
];
[
self
.
contentView
addConstraint
:
questionWidth
];
NSLayoutConstraint
*
question
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_questionBtn
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
question
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_questionBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
caseBtn
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
questionLef
t
];
[
self
.
contentView
addConstraint
:
questionRigh
t
];
NSLayoutConstraint
*
question
Bottom
=
[
NSLayoutConstraint
constraintWithItem
:
_questionBtn
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
question
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_questionBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
_pictureBtn
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
questionBottom
];
[
self
.
contentView
addConstraint
:
questionTop
];
NSLayoutConstraint
*
questionHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_questionBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
_
standard
Btn
attribute
:
NSLayoutAttributeHeight
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
questionHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_questionBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
_
picture
Btn
attribute
:
NSLayoutAttributeHeight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
questionHeight
];
[
self
.
contentView
addConstraint
:
questionHeight
];
}
}
return
_questionBtn
;
return
_questionBtn
;
}
}
-
(
UIButton
*
)
caseBtn
-
(
HomeCellItem
*
)
caseBtn
{
{
if
(
!
_caseBtn
)
{
if
(
!
_caseBtn
)
{
_caseBtn
=
[[
UIButton
alloc
]
init
];
_caseBtn
=
[[
HomeCellItem
alloc
]
init
];
_caseBtn
.
backgroundColor
=
[
UIColor
purpleColor
];
[
_caseBtn
setImage
:[
UIImage
imageNamed
:
@"excellent_case"
]
forState
:
UIControlStateNormal
];
_caseBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_caseBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_caseBtn
];
[
self
.
contentView
addSubview
:
_caseBtn
];
NSLayoutConstraint
*
caseLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_caseBtn
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
questionBtn
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
caseLeft
];
NSLayoutConstraint
*
case
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_caseBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
case
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_caseBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
_questionBtn
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
caseRight
];
[
self
.
contentView
addConstraint
:
caseTop
];
NSLayoutConstraint
*
case
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_caseBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
8
0
];
NSLayoutConstraint
*
case
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_caseBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
caseHe
ight
];
[
self
.
contentView
addConstraint
:
caseR
ight
];
NSLayoutConstraint
*
case
Bottom
=
[
NSLayoutConstraint
constraintWithItem
:
_caseBtn
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
case
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_caseBtn
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
_questionBtn
attribute
:
NSLayoutAttributeHeight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
caseBottom
];
[
self
.
contentView
addConstraint
:
caseHeight
];
}
}
return
_caseBtn
;
return
_caseBtn
;
}
}
-
(
UIView
*
)
lineView
{
if
(
!
_lineView
)
{
_lineView
=
[[
UIView
alloc
]
init
];
_lineView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
contentView
addSubview
:
_lineView
];
NSLayoutConstraint
*
lineViewLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
lineViewLeft
];
NSLayoutConstraint
*
lineViewRight
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
lineViewRight
];
NSLayoutConstraint
*
lineViewBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
lineViewBottom
];
NSLayoutConstraint
*
lineViewHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
2
];
[
self
.
contentView
addConstraint
:
lineViewHeight
];
}
return
_lineView
;
}
@end
@end
redstar/Classes/Module/Home/Cell/NewAnnounceCell.m
View file @
3a46e680
...
@@ -32,7 +32,8 @@
...
@@ -32,7 +32,8 @@
#pragma mark - Private Methods
#pragma mark - Private Methods
-
(
void
)
setup
-
(
void
)
setup
{
{
self
.
announceLabel
.
textColor
=
kAnnounceTextColor
;
self
.
pointLabel
.
text
=
@"···"
;
}
}
#pragma mark - Lazy Loading
#pragma mark - Lazy Loading
...
@@ -41,12 +42,13 @@
...
@@ -41,12 +42,13 @@
if
(
!
_announceLabel
)
{
if
(
!
_announceLabel
)
{
_announceLabel
=
[[
UILabel
alloc
]
init
];
_announceLabel
=
[[
UILabel
alloc
]
init
];
_announceLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_announceLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_announceLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
[
self
.
contentView
addSubview
:
_announceLabel
];
[
self
.
contentView
addSubview
:
_announceLabel
];
NSLayoutConstraint
*
announceTop
=
[
NSLayoutConstraint
constraintWithItem
:
_announceLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
announceTop
=
[
NSLayoutConstraint
constraintWithItem
:
_announceLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
announceTop
];
[
self
.
contentView
addConstraint
:
announceTop
];
NSLayoutConstraint
*
announceLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_announceLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
announceLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_announceLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
2
0
];
[
self
.
contentView
addConstraint
:
announceLeft
];
[
self
.
contentView
addConstraint
:
announceLeft
];
NSLayoutConstraint
*
announceRight
=
[
NSLayoutConstraint
constraintWithItem
:
_announceLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
pointLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
announceRight
=
[
NSLayoutConstraint
constraintWithItem
:
_announceLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
pointLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
...
@@ -63,21 +65,25 @@
...
@@ -63,21 +65,25 @@
{
{
if
(
!
_pointLabel
)
{
if
(
!
_pointLabel
)
{
_pointLabel
=
[[
UILabel
alloc
]
init
];
_pointLabel
=
[[
UILabel
alloc
]
init
];
_pointLabel
.
textColor
=
kPointColor
;
_pointLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_pointLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_pointLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
[
self
.
contentView
addSubview
:
_pointLabel
];
[
self
.
contentView
addSubview
:
_pointLabel
];
NSLayoutConstraint
*
pointTop
=
[
NSLayoutConstraint
constraintWithItem
:
_pointLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
pointTop
=
[
NSLayoutConstraint
constraintWithItem
:
_pointLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
pointTop
];
[
self
.
contentView
addConstraint
:
pointTop
];
NSLayoutConstraint
*
point
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_pointLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
point
Width
=
[
NSLayoutConstraint
constraintWithItem
:
_pointLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
2
0
];
[
self
.
contentView
addConstraint
:
point
Left
];
[
self
.
contentView
addConstraint
:
point
Width
];
NSLayoutConstraint
*
pointRight
=
[
NSLayoutConstraint
constraintWithItem
:
_pointLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
pointLabel
attribute
:
NSLayoutAttributeLef
t
multiplier
:
1
.
0
constant
:-
20
];
NSLayoutConstraint
*
pointRight
=
[
NSLayoutConstraint
constraintWithItem
:
_pointLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRigh
t
multiplier
:
1
.
0
constant
:-
20
];
[
self
.
contentView
addConstraint
:
pointRight
];
[
self
.
contentView
addConstraint
:
pointRight
];
NSLayoutConstraint
*
pointBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_pointLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
pointBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_pointLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
pointBottom
];
[
self
.
contentView
addConstraint
:
pointBottom
];
}
}
return
_pointLabel
;
return
_pointLabel
;
}
}
...
...
redstar/Classes/Module/Home/View/HomeHeaderView.m
View file @
3a46e680
...
@@ -166,10 +166,12 @@
...
@@ -166,10 +166,12 @@
_weatherLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_weatherLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_weatherLabel
.
textAlignment
=
NSTextAlignmentRight
;
_weatherLabel
.
textAlignment
=
NSTextAlignmentRight
;
_weatherLabel
.
textColor
=
[
UIColor
whiteColor
];
_weatherLabel
.
textColor
=
[
UIColor
whiteColor
];
_weatherLabel
.
font
=
[
UIFont
boldSystemFontOfSize
:
14
.
0
];
_weatherLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
[
_weatherLabel
setShadowColor
:[
UIColor
blackColor
]];
[
_weatherLabel
setShadowOffset
:
CGSizeMake
(
1
,
1
)];
[
self
insertSubview
:
_weatherLabel
aboveSubview
:
self
.
scrollView
];
[
self
insertSubview
:
_weatherLabel
aboveSubview
:
self
.
scrollView
];
NSLayoutConstraint
*
weatherHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_weatherLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
20
];
NSLayoutConstraint
*
weatherHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_weatherLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
35
];
[
_weatherLabel
addConstraint
:
weatherHeight
];
[
_weatherLabel
addConstraint
:
weatherHeight
];
NSLayoutConstraint
*
weatherRight
=
[
NSLayoutConstraint
constraintWithItem
:
_weatherLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
10
];
NSLayoutConstraint
*
weatherRight
=
[
NSLayoutConstraint
constraintWithItem
:
_weatherLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
10
];
...
...
redstar/Classes/Module/Home/ViewController/HomeViewController.m
View file @
3a46e680
...
@@ -9,11 +9,12 @@
...
@@ -9,11 +9,12 @@
#import "HomeViewController.h"
#import "HomeViewController.h"
#import "HomeHeaderView.h"
#import "HomeHeaderView.h"
#import "HomeFunctionCell.h"
#import "HomeFunctionCell.h"
#import "NewAnnounceCell.h"
#import "InspectListViewController.h"
#import "InspectListViewController.h"
#import "RankingListViewController.h"
#import "RankingListViewController.h"
#define k
HomeCell @"Hom
eTableViewCell"
#define k
NewAnnounceCell @"NewAnnounc
eTableViewCell"
#define kHomeFunctionCell @"HomeFunctionCell"
#define kHomeFunctionCell @"HomeFunctionCell"
@interface
HomeViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
UIScrollViewDelegate
>
@interface
HomeViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
UIScrollViewDelegate
>
...
@@ -126,13 +127,11 @@
...
@@ -126,13 +127,11 @@
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
{
if
(
indexPath
.
section
==
0
)
{
if
(
indexPath
.
section
==
0
)
{
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kHom
eCell
];
NewAnnounceCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kNewAnnounc
eCell
];
if
(
!
cell
)
{
if
(
!
cell
)
{
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kHom
eCell
];
cell
=
[[
NewAnnounceCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kNewAnnounc
eCell
];
}
}
// 设置cell右边有个小箭头
cell
.
announceLabel
.
text
=
_announeArray
[
indexPath
.
row
];
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
cell
.
textLabel
.
text
=
_announeArray
[
indexPath
.
row
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
return
cell
;
return
cell
;
...
@@ -214,8 +213,8 @@
...
@@ -214,8 +213,8 @@
// 箭头Iamge
// 箭头Iamge
UIImageView
*
arrowIamgeView
=
[[
UIImageView
alloc
]
init
];
UIImageView
*
arrowIamgeView
=
[[
UIImageView
alloc
]
init
];
arrowIamgeView
.
image
=
[
UIImage
imageNamed
:
@"arrow_right"
];
arrowIamgeView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
arrowIamgeView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
arrowIamgeView
.
backgroundColor
=
[
UIColor
purpleColor
];
[
sectionView
addSubview
:
arrowIamgeView
];
[
sectionView
addSubview
:
arrowIamgeView
];
// moreButton布局
// moreButton布局
...
@@ -232,16 +231,16 @@
...
@@ -232,16 +231,16 @@
[
sectionView
addConstraint
:
moreButtonBottom
];
[
sectionView
addConstraint
:
moreButtonBottom
];
// arrowIamgeView布局
// arrowIamgeView布局
NSLayoutConstraint
*
arrowIamgeViewTop
=
[
NSLayoutConstraint
constraintWithItem
:
arrowIamgeView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
0
];
NSLayoutConstraint
*
arrowIamgeViewTop
=
[
NSLayoutConstraint
constraintWithItem
:
arrowIamgeView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
3
];
[
sectionView
addConstraint
:
arrowIamgeViewTop
];
[
sectionView
addConstraint
:
arrowIamgeViewTop
];
NSLayoutConstraint
*
arrowIamgeViewRight
=
[
NSLayoutConstraint
constraintWithItem
:
arrowIamgeView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
15
];
NSLayoutConstraint
*
arrowIamgeViewRight
=
[
NSLayoutConstraint
constraintWithItem
:
arrowIamgeView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
sectionView
addConstraint
:
arrowIamgeViewRight
];
[
sectionView
addConstraint
:
arrowIamgeViewRight
];
NSLayoutConstraint
*
arrowIamgeViewWidth
=
[
NSLayoutConstraint
constraintWithItem
:
arrowIamgeView
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
16
];
NSLayoutConstraint
*
arrowIamgeViewWidth
=
[
NSLayoutConstraint
constraintWithItem
:
arrowIamgeView
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
7
];
[
sectionView
addConstraint
:
arrowIamgeViewWidth
];
[
sectionView
addConstraint
:
arrowIamgeViewWidth
];
NSLayoutConstraint
*
arrowIamgeViewHeight
=
[
NSLayoutConstraint
constraintWithItem
:
arrowIamgeView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
1
6
];
NSLayoutConstraint
*
arrowIamgeViewHeight
=
[
NSLayoutConstraint
constraintWithItem
:
arrowIamgeView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
1
2
];
[
sectionView
addConstraint
:
arrowIamgeViewHeight
];
[
sectionView
addConstraint
:
arrowIamgeViewHeight
];
}
else
{
}
else
{
...
@@ -260,7 +259,7 @@
...
@@ -260,7 +259,7 @@
_tableView
.
dataSource
=
self
;
_tableView
.
dataSource
=
self
;
_tableView
.
showsVerticalScrollIndicator
=
NO
;
_tableView
.
showsVerticalScrollIndicator
=
NO
;
_tableView
.
showsHorizontalScrollIndicator
=
NO
;
_tableView
.
showsHorizontalScrollIndicator
=
NO
;
[
_tableView
registerClass
:[
UITableViewCell
class
]
forCellReuseIdentifier
:
kHom
eCell
];
[
_tableView
registerClass
:[
NewAnnounceCell
class
]
forCellReuseIdentifier
:
kNewAnnounc
eCell
];
[
_tableView
registerClass
:[
HomeFunctionCell
class
]
forCellReuseIdentifier
:
kHomeFunctionCell
];
[
_tableView
registerClass
:[
HomeFunctionCell
class
]
forCellReuseIdentifier
:
kHomeFunctionCell
];
[
self
.
view
addSubview
:
_tableView
];
[
self
.
view
addSubview
:
_tableView
];
...
...
redstar/Classes/Module/Login/View/LoginView.m
View file @
3a46e680
...
@@ -41,8 +41,8 @@
...
@@ -41,8 +41,8 @@
[
self
.
loginButton
setTitle
:
@"登 录"
forState
:
UIControlStateNormal
];
[
self
.
loginButton
setTitle
:
@"登 录"
forState
:
UIControlStateNormal
];
self
.
usernameImageView
.
image
=
[
UIImage
imageNamed
:
@"
aboutme_unchecked
"
];
self
.
usernameImageView
.
image
=
[
UIImage
imageNamed
:
@"
username_icon
"
];
self
.
passwordImageView
.
image
=
[
UIImage
imageNamed
:
@"
Login_password
"
];
self
.
passwordImageView
.
image
=
[
UIImage
imageNamed
:
@"
password_icon
"
];
self
.
usernameTextFiled
.
clearButtonMode
=
UITextFieldViewModeAlways
;
self
.
usernameTextFiled
.
clearButtonMode
=
UITextFieldViewModeAlways
;
self
.
passwordTextFiled
.
clearButtonMode
=
UITextFieldViewModeAlways
;
self
.
passwordTextFiled
.
clearButtonMode
=
UITextFieldViewModeAlways
;
...
@@ -129,17 +129,18 @@
...
@@ -129,17 +129,18 @@
[
self
.
usernameView
addConstraint
:
usernameImageViewTop
];
[
self
.
usernameView
addConstraint
:
usernameImageViewTop
];
// 左边
// 左边
NSLayoutConstraint
*
usernameImageViewLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_usernameImageView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
_usernameView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
1
5
];
NSLayoutConstraint
*
usernameImageViewLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_usernameImageView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
_usernameView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
1
4
];
[
self
.
usernameView
addConstraint
:
usernameImageViewLeft
];
[
self
.
usernameView
addConstraint
:
usernameImageViewLeft
];
// 底部
// 底部
NSLayoutConstraint
*
usernameImageViewHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_usernameImageView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
2
2
];
NSLayoutConstraint
*
usernameImageViewHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_usernameImageView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
2
1
];
[
self
.
usernameView
addConstraint
:
usernameImageViewHeight
];
[
self
.
usernameView
addConstraint
:
usernameImageViewHeight
];
// 宽度
// 宽度
NSLayoutConstraint
*
usernameImageViewWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_usernameImageView
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
24
];
NSLayoutConstraint
*
usernameImageViewWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_usernameImageView
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
24
];
[
_usernameImageView
addConstraint
:
usernameImageViewWidth
];
[
_usernameImageView
addConstraint
:
usernameImageViewWidth
];
return
_usernameImageView
;
return
_usernameImageView
;
}
}
...
@@ -152,19 +153,19 @@
...
@@ -152,19 +153,19 @@
[
self
.
passwordView
addSubview
:
_passwordImageView
];
[
self
.
passwordView
addSubview
:
_passwordImageView
];
// 顶端
// 顶端
NSLayoutConstraint
*
passwordImageViewTop
=
[
NSLayoutConstraint
constraintWithItem
:
_passwordImageView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
_passwordView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
3
];
NSLayoutConstraint
*
passwordImageViewTop
=
[
NSLayoutConstraint
constraintWithItem
:
_passwordImageView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
_passwordView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
4
];
[
self
.
passwordView
addConstraint
:
passwordImageViewTop
];
[
self
.
passwordView
addConstraint
:
passwordImageViewTop
];
// 左边
// 左边
NSLayoutConstraint
*
passwordImageViewLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_passwordImageView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
_passwordView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
1
5
];
NSLayoutConstraint
*
passwordImageViewLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_passwordImageView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
_passwordView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
1
7
];
[
self
.
passwordView
addConstraint
:
passwordImageViewLeft
];
[
self
.
passwordView
addConstraint
:
passwordImageViewLeft
];
// 底部
// 底部
NSLayoutConstraint
*
passwordImageViewBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_passwordImageView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
2
2
];
NSLayoutConstraint
*
passwordImageViewBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_passwordImageView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
2
3
];
[
self
.
passwordView
addConstraint
:
passwordImageViewBottom
];
[
self
.
passwordView
addConstraint
:
passwordImageViewBottom
];
// 宽度
// 宽度
NSLayoutConstraint
*
passwordImageViewWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_passwordImageView
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
24
];
NSLayoutConstraint
*
passwordImageViewWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_passwordImageView
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
19
];
[
_passwordImageView
addConstraint
:
passwordImageViewWidth
];
[
_passwordImageView
addConstraint
:
passwordImageViewWidth
];
return
_passwordImageView
;
return
_passwordImageView
;
...
...
redstar/Classes/Module/Login/ViewController/LoginViewController.m
View file @
3a46e680
...
@@ -164,13 +164,11 @@
...
@@ -164,13 +164,11 @@
-
(
void
)
tabBarController
:
(
UITabBarController
*
)
tabBarController
didSelectViewController
:
(
UIViewController
*
)
viewController
-
(
void
)
tabBarController
:
(
UITabBarController
*
)
tabBarController
didSelectViewController
:
(
UIViewController
*
)
viewController
{
{
if
([
viewController
isKindOfClass
:[
MineViewController
class
]])
{
if
([
viewController
isKindOfClass
:[
MineViewController
class
]])
{
//tabBarController.hidesBottomBarWhenPushed = YES;
UINavigationController
*
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
viewController
];
UINavigationController
*
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
viewController
];
// nav.hidesBottomBarWhenPushed = YES;
tabBarController
.
tabBar
.
hidden
=
YES
;
tabBarController
.
tabBar
.
hidden
=
YES
;
[
self
presentViewController
:
nav
animated
:
YES
completion
:
nil
];
[
self
presentViewController
:
nav
animated
:
YES
completion
:
nil
];
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment