Commit 50b06048 authored by admin's avatar admin

添加选择商场界面

parent e6c42abd
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
84800D1E1C1FB67300E8B673 /* SelectAreaTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D1D1C1FB67300E8B673 /* SelectAreaTableCell.m */; }; 84800D1E1C1FB67300E8B673 /* SelectAreaTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D1D1C1FB67300E8B673 /* SelectAreaTableCell.m */; };
84800D211C1FB69400E8B673 /* SelectProvinceTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D201C1FB69400E8B673 /* SelectProvinceTableCell.m */; }; 84800D211C1FB69400E8B673 /* SelectProvinceTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D201C1FB69400E8B673 /* SelectProvinceTableCell.m */; };
84800D241C1FB6A000E8B673 /* SelectStoreTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D231C1FB6A000E8B673 /* SelectStoreTableCell.m */; }; 84800D241C1FB6A000E8B673 /* SelectStoreTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D231C1FB6A000E8B673 /* SelectStoreTableCell.m */; };
84800D2F1C1FF71200E8B673 /* RankListTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D2E1C1FF71200E8B673 /* RankListTableHeaderView.m */; };
8480BEA21C14326100E2F18F /* MoreScreenView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8480BEA11C14326100E2F18F /* MoreScreenView.m */; }; 8480BEA21C14326100E2F18F /* MoreScreenView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8480BEA11C14326100E2F18F /* MoreScreenView.m */; };
8480BEA61C14378C00E2F18F /* ScopeTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8480BEA51C14378C00E2F18F /* ScopeTableView.m */; }; 8480BEA61C14378C00E2F18F /* ScopeTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8480BEA51C14378C00E2F18F /* ScopeTableView.m */; };
8480BEA91C143A0800E2F18F /* GroupTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8480BEA81C143A0800E2F18F /* GroupTableView.m */; }; 8480BEA91C143A0800E2F18F /* GroupTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8480BEA81C143A0800E2F18F /* GroupTableView.m */; };
...@@ -127,6 +126,9 @@ ...@@ -127,6 +126,9 @@
84D8636F1C1148EC00E4F4CC /* InspectAddCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8636B1C1148EC00E4F4CC /* InspectAddCell.m */; }; 84D8636F1C1148EC00E4F4CC /* InspectAddCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8636B1C1148EC00E4F4CC /* InspectAddCell.m */; };
84D863701C1148EC00E4F4CC /* InspectPicAddCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8636D1C1148EC00E4F4CC /* InspectPicAddCell.m */; }; 84D863701C1148EC00E4F4CC /* InspectPicAddCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8636D1C1148EC00E4F4CC /* InspectPicAddCell.m */; };
84D863731C11923F00E4F4CC /* AddQuestionTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D863721C11923F00E4F4CC /* AddQuestionTableCell.m */; }; 84D863731C11923F00E4F4CC /* AddQuestionTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D863721C11923F00E4F4CC /* AddQuestionTableCell.m */; };
84D98D131C210F3300C7C96F /* RankScreenTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D98D121C210F3300C7C96F /* RankScreenTableViewCell.m */; };
84D98D161C21371D00C7C96F /* SelectStoreHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D98D151C21371D00C7C96F /* SelectStoreHeadView.m */; };
84D98D191C21507500C7C96F /* CheckBoxButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D98D181C21507500C7C96F /* CheckBoxButton.m */; };
84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */; }; 84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */; };
84DB9BC71BDCD67200822CC4 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC61BDCD67200822CC4 /* UIView+Extension.m */; }; 84DB9BC71BDCD67200822CC4 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC61BDCD67200822CC4 /* UIView+Extension.m */; };
84E0ABCD1BFB082E001C8F45 /* TaskDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E0ABCC1BFB082E001C8F45 /* TaskDetailModel.m */; }; 84E0ABCD1BFB082E001C8F45 /* TaskDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E0ABCC1BFB082E001C8F45 /* TaskDetailModel.m */; };
...@@ -231,8 +233,6 @@ ...@@ -231,8 +233,6 @@
84800D201C1FB69400E8B673 /* SelectProvinceTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectProvinceTableCell.m; sourceTree = "<group>"; }; 84800D201C1FB69400E8B673 /* SelectProvinceTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectProvinceTableCell.m; sourceTree = "<group>"; };
84800D221C1FB6A000E8B673 /* SelectStoreTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectStoreTableCell.h; sourceTree = "<group>"; }; 84800D221C1FB6A000E8B673 /* SelectStoreTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectStoreTableCell.h; sourceTree = "<group>"; };
84800D231C1FB6A000E8B673 /* SelectStoreTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectStoreTableCell.m; sourceTree = "<group>"; }; 84800D231C1FB6A000E8B673 /* SelectStoreTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectStoreTableCell.m; sourceTree = "<group>"; };
84800D2D1C1FF71200E8B673 /* RankListTableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankListTableHeaderView.h; sourceTree = "<group>"; };
84800D2E1C1FF71200E8B673 /* RankListTableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankListTableHeaderView.m; sourceTree = "<group>"; };
8480BEA01C14326100E2F18F /* MoreScreenView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoreScreenView.h; sourceTree = "<group>"; }; 8480BEA01C14326100E2F18F /* MoreScreenView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoreScreenView.h; sourceTree = "<group>"; };
8480BEA11C14326100E2F18F /* MoreScreenView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MoreScreenView.m; sourceTree = "<group>"; }; 8480BEA11C14326100E2F18F /* MoreScreenView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MoreScreenView.m; sourceTree = "<group>"; };
8480BEA41C14378C00E2F18F /* ScopeTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopeTableView.h; sourceTree = "<group>"; }; 8480BEA41C14378C00E2F18F /* ScopeTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopeTableView.h; sourceTree = "<group>"; };
...@@ -410,6 +410,12 @@ ...@@ -410,6 +410,12 @@
84D8636D1C1148EC00E4F4CC /* InspectPicAddCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectPicAddCell.m; sourceTree = "<group>"; }; 84D8636D1C1148EC00E4F4CC /* InspectPicAddCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectPicAddCell.m; sourceTree = "<group>"; };
84D863711C11923F00E4F4CC /* AddQuestionTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddQuestionTableCell.h; sourceTree = "<group>"; }; 84D863711C11923F00E4F4CC /* AddQuestionTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddQuestionTableCell.h; sourceTree = "<group>"; };
84D863721C11923F00E4F4CC /* AddQuestionTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddQuestionTableCell.m; sourceTree = "<group>"; }; 84D863721C11923F00E4F4CC /* AddQuestionTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddQuestionTableCell.m; sourceTree = "<group>"; };
84D98D111C210F3300C7C96F /* RankScreenTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankScreenTableViewCell.h; sourceTree = "<group>"; };
84D98D121C210F3300C7C96F /* RankScreenTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankScreenTableViewCell.m; sourceTree = "<group>"; };
84D98D141C21371D00C7C96F /* SelectStoreHeadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectStoreHeadView.h; sourceTree = "<group>"; };
84D98D151C21371D00C7C96F /* SelectStoreHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectStoreHeadView.m; sourceTree = "<group>"; };
84D98D171C21507500C7C96F /* CheckBoxButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckBoxButton.h; sourceTree = "<group>"; };
84D98D181C21507500C7C96F /* CheckBoxButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CheckBoxButton.m; sourceTree = "<group>"; };
84DB9BC21BDCD4B600822CC4 /* CustomDropMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomDropMenuView.h; sourceTree = "<group>"; }; 84DB9BC21BDCD4B600822CC4 /* CustomDropMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomDropMenuView.h; sourceTree = "<group>"; };
84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomDropMenuView.m; sourceTree = "<group>"; }; 84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomDropMenuView.m; sourceTree = "<group>"; };
84DB9BC51BDCD67200822CC4 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; }; 84DB9BC51BDCD67200822CC4 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; };
...@@ -705,8 +711,6 @@ ...@@ -705,8 +711,6 @@
children = ( children = (
846206B31C06AF700015C456 /* RankListHeaderView.h */, 846206B31C06AF700015C456 /* RankListHeaderView.h */,
846206B41C06AF700015C456 /* RankListHeaderView.m */, 846206B41C06AF700015C456 /* RankListHeaderView.m */,
84800D2D1C1FF71200E8B673 /* RankListTableHeaderView.h */,
84800D2E1C1FF71200E8B673 /* RankListTableHeaderView.m */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -751,6 +755,8 @@ ...@@ -751,6 +755,8 @@
84800D201C1FB69400E8B673 /* SelectProvinceTableCell.m */, 84800D201C1FB69400E8B673 /* SelectProvinceTableCell.m */,
84800D221C1FB6A000E8B673 /* SelectStoreTableCell.h */, 84800D221C1FB6A000E8B673 /* SelectStoreTableCell.h */,
84800D231C1FB6A000E8B673 /* SelectStoreTableCell.m */, 84800D231C1FB6A000E8B673 /* SelectStoreTableCell.m */,
84D98D171C21507500C7C96F /* CheckBoxButton.h */,
84D98D181C21507500C7C96F /* CheckBoxButton.m */,
); );
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -771,6 +777,8 @@ ...@@ -771,6 +777,8 @@
846ABE061C1EE3970020C331 /* View */ = { 846ABE061C1EE3970020C331 /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
84D98D141C21371D00C7C96F /* SelectStoreHeadView.h */,
84D98D151C21371D00C7C96F /* SelectStoreHeadView.m */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1010,6 +1018,8 @@ ...@@ -1010,6 +1018,8 @@
84846E991BE07CDF0010550A /* RankingListCell.m */, 84846E991BE07CDF0010550A /* RankingListCell.m */,
846206B91C06AFF50015C456 /* RankCommentCell.h */, 846206B91C06AFF50015C456 /* RankCommentCell.h */,
846206BA1C06AFF50015C456 /* RankCommentCell.m */, 846206BA1C06AFF50015C456 /* RankCommentCell.m */,
84D98D111C210F3300C7C96F /* RankScreenTableViewCell.h */,
84D98D121C210F3300C7C96F /* RankScreenTableViewCell.m */,
); );
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2185,6 +2195,7 @@ ...@@ -2185,6 +2195,7 @@
846ABE0C1C1EE3970020C331 /* StoreModel.m in Sources */, 846ABE0C1C1EE3970020C331 /* StoreModel.m in Sources */,
84F57C501BEC7AA300DDEEB1 /* AddQuestionFooterView.m in Sources */, 84F57C501BEC7AA300DDEEB1 /* AddQuestionFooterView.m in Sources */,
84CF0F1E1BE9B40400C855CE /* InspectDetailFooterView.m in Sources */, 84CF0F1E1BE9B40400C855CE /* InspectDetailFooterView.m in Sources */,
84D98D161C21371D00C7C96F /* SelectStoreHeadView.m in Sources */,
84F30DA41BFC19F200CBAD13 /* RankListModel.m in Sources */, 84F30DA41BFC19F200CBAD13 /* RankListModel.m in Sources */,
84CC34EF1C09AEC0002F10E2 /* LookOnLineDetailViewController.m in Sources */, 84CC34EF1C09AEC0002F10E2 /* LookOnLineDetailViewController.m in Sources */,
8487D8091BF20FAD00E63E90 /* TaxisView.m in Sources */, 8487D8091BF20FAD00E63E90 /* TaxisView.m in Sources */,
...@@ -2197,6 +2208,7 @@ ...@@ -2197,6 +2208,7 @@
848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */, 848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */,
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */, 84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */,
84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */, 84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */,
84D98D191C21507500C7C96F /* CheckBoxButton.m in Sources */,
8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */, 8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */,
84AD4F491BF4BC0600BFB37C /* RankDetailTableCell.m in Sources */, 84AD4F491BF4BC0600BFB37C /* RankDetailTableCell.m in Sources */,
848699B31BDF810900859DFE /* InspectTaskViewController.m in Sources */, 848699B31BDF810900859DFE /* InspectTaskViewController.m in Sources */,
...@@ -2228,7 +2240,6 @@ ...@@ -2228,7 +2240,6 @@
84AD4F3D1BF4894D00BFB37C /* RankDetailView.m in Sources */, 84AD4F3D1BF4894D00BFB37C /* RankDetailView.m in Sources */,
84C972961C1ABE08003A3276 /* PicScreenView.m in Sources */, 84C972961C1ABE08003A3276 /* PicScreenView.m in Sources */,
8473E38B1C1BCFC400960257 /* InspectTitleTableViewCell.m in Sources */, 8473E38B1C1BCFC400960257 /* InspectTitleTableViewCell.m in Sources */,
84800D2F1C1FF71200E8B673 /* RankListTableHeaderView.m in Sources */,
84ECCF1B1C0210F000EA4960 /* CommentModel.m in Sources */, 84ECCF1B1C0210F000EA4960 /* CommentModel.m in Sources */,
846ABDF51C1E5E780020C331 /* PictureListModel.m in Sources */, 846ABDF51C1E5E780020C331 /* PictureListModel.m in Sources */,
84E0ABCD1BFB082E001C8F45 /* TaskDetailModel.m in Sources */, 84E0ABCD1BFB082E001C8F45 /* TaskDetailModel.m in Sources */,
...@@ -2276,6 +2287,7 @@ ...@@ -2276,6 +2287,7 @@
84A673C11C0C7AEB000F828E /* AnnounceViewController.m in Sources */, 84A673C11C0C7AEB000F828E /* AnnounceViewController.m in Sources */,
842547FC1BF03977006C79C5 /* QuestionModel.m in Sources */, 842547FC1BF03977006C79C5 /* QuestionModel.m in Sources */,
84E420441BE84A2300689976 /* QuestionCommentCell.m in Sources */, 84E420441BE84A2300689976 /* QuestionCommentCell.m in Sources */,
84D98D131C210F3300C7C96F /* RankScreenTableViewCell.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "no_select_box@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "no_select_box@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "select_box@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "select_box@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "选中@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "选中@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "形状-49@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "形状-49@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "x@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "x@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -130,6 +130,7 @@ ...@@ -130,6 +130,7 @@
#define kResultTitleBackColor [UIColor colorWithRed:238 / 255.0 green:238 / 255.0 blue:244 / 255.0 alpha:1.0] #define kResultTitleBackColor [UIColor colorWithRed:238 / 255.0 green:238 / 255.0 blue:244 / 255.0 alpha:1.0]
#define kSelectStoreColor [UIColor colorWithRed:111 / 255.0 green:120 / 255.0 blue:216 / 255.0 alpha:1.0]
#define kCommentViewHeight 300 #define kCommentViewHeight 300
#define kCommentWithStarViewHeight 325 #define kCommentWithStarViewHeight 325
......
...@@ -7,10 +7,14 @@ ...@@ -7,10 +7,14 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ZanButton.h"
@interface OnLineTableViewCell : UITableViewCell @interface OnLineTableViewCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *selectLabel; @property (nonatomic, strong) UILabel *selectLabel;
@property (nonatomic, strong) UIButton *storeBtn;
@property (nonatomic, strong) UIButton *averageBtn;
@end @end
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
- (void)setup - (void)setup
{ {
self.titleLabel.textColor = kOnLineCellTitleColor; self.titleLabel.textColor = kOnLineCellTitleColor;
self.selectLabel.textColor = kOnLineCellDetailColor;
} }
...@@ -56,6 +55,9 @@ ...@@ -56,6 +55,9 @@
// 高度 // 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:titleBottom]; [self.contentView addConstraint:titleBottom];
// 高度
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50];
[self.contentView addConstraint:titleHeight];
} }
return _titleLabel; return _titleLabel;
...@@ -66,6 +68,7 @@ ...@@ -66,6 +68,7 @@
{ {
if (!_selectLabel) { if (!_selectLabel) {
_selectLabel = [[UILabel alloc] init]; _selectLabel = [[UILabel alloc] init];
_selectLabel.textColor = kOnLineCellDetailColor;
_selectLabel.textAlignment = NSTextAlignmentRight; _selectLabel.textAlignment = NSTextAlignmentRight;
_selectLabel.translatesAutoresizingMaskIntoConstraints = NO; _selectLabel.translatesAutoresizingMaskIntoConstraints = NO;
_selectLabel.font = [UIFont systemFontOfSize:15.0]; _selectLabel.font = [UIFont systemFontOfSize:15.0];
...@@ -80,9 +83,9 @@ ...@@ -80,9 +83,9 @@
[self.contentView addConstraint:selectRight]; [self.contentView addConstraint:selectRight];
// 右边 // 右边
NSLayoutConstraint *selectWidth = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]; // NSLayoutConstraint *selectWidth = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50];
[self.contentView addConstraint:selectWidth]; // [self.contentView addConstraint:selectWidth];
//
// 高度 // 高度
NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:selectBottom]; [self.contentView addConstraint:selectBottom];
...@@ -90,4 +93,73 @@ ...@@ -90,4 +93,73 @@
return _selectLabel; return _selectLabel;
} }
- (UIButton *)storeBtn
{
if (!_storeBtn) {
_storeBtn = [[UIButton alloc] init];
[_storeBtn setTitleColor:kOnLineCellTitleColor forState:UIControlStateNormal];
_storeBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_storeBtn setImage:[UIImage imageNamed:@"select_box"] forState:UIControlStateNormal];
[_storeBtn setImage:[UIImage imageNamed:@"on_select_box"] forState:UIControlStateSelected];
_storeBtn.titleLabel.font = [UIFont systemFontOfSize:15.0f];
_storeBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_storeBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
_storeBtn.imageView.contentMode = UIViewContentModeRight;
_storeBtn.titleLabel.contentMode = UIViewContentModeLeft;
[self.contentView addSubview:_storeBtn];
// 顶端
NSLayoutConstraint *selectTop = [NSLayoutConstraint constraintWithItem:_storeBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:selectTop];
// 左边
NSLayoutConstraint *selectRight = [NSLayoutConstraint constraintWithItem:_storeBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-122];
[self.contentView addConstraint:selectRight];
// 右边
NSLayoutConstraint *selectWidth = [NSLayoutConstraint constraintWithItem:_storeBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:80];
[self.contentView addConstraint:selectWidth];
// 高度
NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_storeBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:selectBottom];
}
return _storeBtn;
}
- (UIButton *)averageBtn
{
if (!_averageBtn) {
_averageBtn = [[UIButton alloc] init];
[_averageBtn setTitleColor:kOnLineCellTitleColor forState:UIControlStateNormal];
_averageBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_averageBtn setImage:[UIImage imageNamed:@"select_box"] forState:UIControlStateNormal];
[_averageBtn setImage:[UIImage imageNamed:@"on_select_box"] forState:UIControlStateSelected];
_averageBtn.titleLabel.font = [UIFont systemFontOfSize:15.0f];
_averageBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_averageBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
_averageBtn.imageView.contentMode = UIViewContentModeRight;
_averageBtn.titleLabel.contentMode = UIViewContentModeLeft;
[self.contentView addSubview:_averageBtn];
// 顶端
NSLayoutConstraint *selectTop = [NSLayoutConstraint constraintWithItem:_averageBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:selectTop];
// 左边
NSLayoutConstraint *selectRight = [NSLayoutConstraint constraintWithItem:_averageBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-18];
[self.contentView addConstraint:selectRight];
// 右边
NSLayoutConstraint *selectWidth = [NSLayoutConstraint constraintWithItem:_averageBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:95];
[self.contentView addConstraint:selectWidth];
// 高度
NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_averageBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:selectBottom];
}
return _averageBtn;
}
@end @end
//
// CheckBoxButton.h
// redstar
//
// Created by admin on 15/12/16.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CheckBoxButton : UIButton
@end
//
// CheckBoxButton.m
// redstar
//
// Created by admin on 15/12/16.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "CheckBoxButton.h"
@implementation CheckBoxButton
- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
CGFloat w = self.frame.size.width;
CGFloat h = self.frame.size.height;
return CGRectMake(32, 0, w - 22, h);
}
- (CGRect)imageRectForContentRect:(CGRect)contentRect;
{
CGFloat h = self.frame.size.height;
return CGRectMake(0, (h - 22) / 2, 22, 22);
}
@end
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CheckBoxButton.h"
@interface SelectAreaTableCell : UITableViewCell @interface SelectAreaTableCell : UITableViewCell
@property (nonatomic, strong) UIImageView *checkBoxImageView; @property (nonatomic, strong) CheckBoxButton *checkBoxButton;
@property (nonatomic, strong) UIImageView *iconImageView; @property (nonatomic, strong) UIImageView *iconImageView;
@end @end
...@@ -10,8 +10,70 @@ ...@@ -10,8 +10,70 @@
@implementation SelectAreaTableCell @implementation SelectAreaTableCell
- (void)awakeFromNib { - (CheckBoxButton *)checkBoxButton
// Initialization code {
if (!_checkBoxButton) {
_checkBoxButton = [[CheckBoxButton alloc] init];
[_checkBoxButton setTitleColor:kLightBlack forState:UIControlStateNormal];
[_checkBoxButton setTitleColor:kSelectStoreColor forState:UIControlStateSelected];
_checkBoxButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
_checkBoxButton.translatesAutoresizingMaskIntoConstraints = NO;
[_checkBoxButton setImage:[UIImage imageNamed:@"uncheck_box"] forState:UIControlStateNormal];
[_checkBoxButton setImage:[UIImage imageNamed:@"check_box"] forState:UIControlStateSelected];
_checkBoxButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_checkBoxButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
_checkBoxButton.imageView.contentMode = UIViewContentModeRight;
_checkBoxButton.titleLabel.contentMode = UIViewContentModeLeft;
[_checkBoxButton addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:_checkBoxButton];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:8];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:34];
[self.contentView addConstraint:titleHeight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-8];
[self.contentView addConstraint:titleBottom];
}
return _checkBoxButton;
}
- (void)click:(CheckBoxButton *)sender
{
sender.selected = !sender.selected;
}
- (UIImageView *)iconImageView
{
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
_iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_iconImageView];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:23];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:13];
[self.contentView addConstraint:titleWidth];
// 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleRight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:8];
[self.contentView addConstraint:titleBottom];
}
return _iconImageView;
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CheckBoxButton.h"
@interface SelectProvinceTableCell : UITableViewCell @interface SelectProvinceTableCell : UITableViewCell
@property (nonatomic, strong) CheckBoxButton *checkBoxButton;
@property (nonatomic, strong) UIImageView *iconImageView;
@end @end
...@@ -10,14 +10,75 @@ ...@@ -10,14 +10,75 @@
@implementation SelectProvinceTableCell @implementation SelectProvinceTableCell
- (void)awakeFromNib { - (CheckBoxButton *)checkBoxButton
// Initialization code {
if (!_checkBoxButton) {
_checkBoxButton = [[CheckBoxButton alloc] init];
[_checkBoxButton setTitleColor:kLightBlack forState:UIControlStateNormal];
[_checkBoxButton setTitleColor:kSelectStoreColor forState:UIControlStateSelected];
_checkBoxButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
_checkBoxButton.translatesAutoresizingMaskIntoConstraints = NO;
[_checkBoxButton setImage:[UIImage imageNamed:@"uncheck_box"] forState:UIControlStateNormal];
[_checkBoxButton setImage:[UIImage imageNamed:@"check_box"] forState:UIControlStateSelected];
_checkBoxButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_checkBoxButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
_checkBoxButton.imageView.contentMode = UIViewContentModeRight;
_checkBoxButton.titleLabel.contentMode = UIViewContentModeLeft;
[_checkBoxButton addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:_checkBoxButton];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:8];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:50];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.contentView addConstraint:titleHeight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-8];
[self.contentView addConstraint:titleBottom];
}
return _checkBoxButton;
}
- (void)click:(CheckBoxButton *)sender
{
sender.selected = !sender.selected;
}
- (UIImageView *)iconImageView
{
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
_iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_iconImageView];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:23];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:11];
[self.contentView addConstraint:titleWidth];
// 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleRight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:7.5];
[self.contentView addConstraint:titleBottom];
}
return _iconImageView;
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
// Configure the view for the selected state // Configure the view for the selected state
} }
@end @end
...@@ -7,7 +7,12 @@ ...@@ -7,7 +7,12 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CheckBoxButton.h"
@interface SelectStoreTableCell : UITableViewCell @interface SelectStoreTableCell : UITableViewCell
//@property (nonatomic, strong) UIButton *storeButton1;
//@property (nonatomic, strong) UIButton *storeButton2;
@property (nonatomic, strong) CheckBoxButton *checkBoxButton;
@end @end
...@@ -9,11 +9,105 @@ ...@@ -9,11 +9,105 @@
#import "SelectStoreTableCell.h" #import "SelectStoreTableCell.h"
@implementation SelectStoreTableCell @implementation SelectStoreTableCell
//- (UIButton *)storeButton1
//{
// if (!_storeButton1) {
// _storeButton1 = [[UIButton alloc] init];
// _storeButton1.translatesAutoresizingMaskIntoConstraints = NO;
// _storeButton1.backgroundColor = [UIColor lightGrayColor];
// [self.contentView addSubview:_storeButton1];
//
// // 顶端
// NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
// [self.contentView addConstraint:titleTop];
//
// // 右边
// NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-5];
// [self.contentView addConstraint:titleRight];
//
// // 左边
// NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
// [self.contentView addConstraint:titleLeft];
//
// // 高度
// NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
// [self.contentView addConstraint:titleHeight];
//
// // 高度
// NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
// [self.contentView addConstraint:titleBottom];
// }
// return _storeButton1;
//}
//
//- (UIButton *)storeButton2
//{
// if (!_storeButton2) {
// _storeButton2 = [[UIButton alloc] init];
// _storeButton2.translatesAutoresizingMaskIntoConstraints = NO;
// _storeButton2.backgroundColor = [UIColor lightGrayColor];
// [self.contentView addSubview:_storeButton2];
//
// // 顶端
// NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_storeButton2 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
// [self.contentView addConstraint:titleTop];
//
// // 右边
// NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_storeButton2 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self.contentView addConstraint:titleRight];
//
// // 左边
// NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_storeButton2 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:5];
// [self.contentView addConstraint:titleLeft];
//
// // 高度
// NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_storeButton2 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
// [self.contentView addConstraint:titleHeight];
// }
// return _storeButton2;
//}
- (void)awakeFromNib { - (CheckBoxButton *)checkBoxButton
// Initialization code {
if (!_checkBoxButton) {
_checkBoxButton = [[CheckBoxButton alloc] init];
[_checkBoxButton setTitleColor:kLightBlack forState:UIControlStateNormal];
[_checkBoxButton setTitleColor:kSelectStoreColor forState:UIControlStateSelected];
_checkBoxButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
_checkBoxButton.translatesAutoresizingMaskIntoConstraints = NO;
[_checkBoxButton setImage:[UIImage imageNamed:@"uncheck_box"] forState:UIControlStateNormal];
[_checkBoxButton setImage:[UIImage imageNamed:@"check_box"] forState:UIControlStateSelected];
_checkBoxButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_checkBoxButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
_checkBoxButton.imageView.contentMode = UIViewContentModeRight;
_checkBoxButton.titleLabel.contentMode = UIViewContentModeLeft;
[_checkBoxButton addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:_checkBoxButton];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:8];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:80];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.contentView addConstraint:titleHeight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-8];
[self.contentView addConstraint:titleBottom];
}
return _checkBoxButton;
}
- (void)click:(CheckBoxButton *)sender
{
sender.selected = !sender.selected;
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
@property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *name;
@property (nonatomic, strong) NSArray *provinceArray; @property (nonatomic, strong) NSArray *provinceArray;
@property (nonatomic, assign) BOOL isChoose;
- (id)initWithName:(NSString *)name children:(NSArray *)children; - (id)initWithName:(NSString *)name children:(NSArray *)children;
+ (id)dataObjectWithName:(NSString *)name children:(NSArray *)children; + (id)dataObjectWithName:(NSString *)name children:(NSArray *)children;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
@interface ProvinceModel : NSObject @interface ProvinceModel : NSObject
@property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *name;
@property (nonatomic, strong) NSArray *storeArray; @property (nonatomic, strong) NSArray *storeArray;
@property (nonatomic, assign) BOOL isChoose;
- (id)initWithName:(NSString *)name children:(NSArray *)children; - (id)initWithName:(NSString *)name children:(NSArray *)children;
+ (id)dataObjectWithName:(NSString *)name children:(NSArray *)children; + (id)dataObjectWithName:(NSString *)name children:(NSArray *)children;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
@interface StoreModel : NSObject @interface StoreModel : NSObject
@property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *name;
@property (nonatomic, assign) BOOL isChoose;
- (id)initWithName:(NSString *)name; - (id)initWithName:(NSString *)name;
+ (id)dataObjectWithName:(NSString *)name; + (id)dataObjectWithName:(NSString *)name;
......
//
// SelectStoreHeadView.h
// redstar
//
// Created by admin on 15/12/16.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SelectStoreHeadView : UIView
@property (nonatomic, strong) UITextField *searchTextFiled; // 搜索框
@end
//
// SelectStoreHeadView.m
// redstar
//
// Created by admin on 15/12/16.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "SelectStoreHeadView.h"
@implementation SelectStoreHeadView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.searchTextFiled.placeholder = @"请输入问题关键字";
self.layer.borderColor = kSeparateLineCGColor;
self.layer.borderWidth = 0.5;
}
return self;
}
#pragma mark - Lazy Loading
- (UITextField *)searchTextFiled
{
if (!_searchTextFiled) {
_searchTextFiled = [[UITextField alloc] init];
_searchTextFiled.font = [UIFont systemFontOfSize:14.0];
_searchTextFiled.backgroundColor = [UIColor whiteColor];
_searchTextFiled.translatesAutoresizingMaskIntoConstraints = NO;
_searchTextFiled.layer.cornerRadius = 4.0;
_searchTextFiled.layer.borderWidth = 1.0;
_searchTextFiled.layer.borderColor = kPasswordBorderColor;
UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"search_icon"]];
imageV.width += 20;
imageV.contentMode = UIViewContentModeCenter;
_searchTextFiled.leftView = imageV;
_searchTextFiled.leftViewMode = UITextFieldViewModeAlways;
UIButton *imageR = [[UIButton alloc] init];
imageR.frame = CGRectMake(0, 0, 28, 28);
[imageR setImage:[UIImage imageNamed:@"close"] forState:UIControlStateNormal];
[imageR addTarget:self action:@selector(searchClick:) forControlEvents:UIControlEventTouchUpInside];
imageR.contentMode = UIViewContentModeCenter;
imageR.width += 10;
_searchTextFiled.rightView = imageR;
_searchTextFiled.rightViewMode = UITextFieldViewModeAlways;
[self addSubview:_searchTextFiled];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_searchTextFiled attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:8];
[self addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_searchTextFiled attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:titleLeft];
// 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_searchTextFiled attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:titleRight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_searchTextFiled attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-8];
[self addConstraint:titleBottom];
}
return _searchTextFiled;
}
- (void)searchClick:(UIButton *)sender
{
self.searchTextFiled.text = @"";
}
@end
...@@ -8,14 +8,26 @@ ...@@ -8,14 +8,26 @@
#import "SelectStoreViewController.h" #import "SelectStoreViewController.h"
#import <RATreeView.h> #import <RATreeView.h>
#import "SelectAreaTableCell.h"
#define kSelectAreaTableCell @"selectAreaTableCell"
#import "SelectProvinceTableCell.h"
#define kSelectProvinceTableCell @"selectProvinceTableCell"
#import "SelectStoreTableCell.h"
#define kSelectStoreTableCell @"selectStoreTableCell"
#import "AreaModel.h" #import "AreaModel.h"
#import "ProvinceModel.h" #import "ProvinceModel.h"
#import "StoreModel.h" #import "StoreModel.h"
#import "SelectStoreHeadView.h"
@interface SelectStoreViewController () <RATreeViewDelegate, RATreeViewDataSource> @interface SelectStoreViewController () <RATreeViewDelegate, RATreeViewDataSource>
@property (nonatomic, strong) RATreeView *treeView; @property (nonatomic, strong) RATreeView *treeView;
@property (nonatomic, strong) NSMutableArray *allAreaData; @property (nonatomic, strong) NSMutableArray *allAreaData;
@property (nonatomic, strong) SelectStoreHeadView *headerView;
@end @end
@implementation SelectStoreViewController @implementation SelectStoreViewController
...@@ -89,7 +101,8 @@ ...@@ -89,7 +101,8 @@
AreaModel *jinghu = [AreaModel dataObjectWithName:@"京沪西南" AreaModel *jinghu = [AreaModel dataObjectWithName:@"京沪西南"
children:[NSArray arrayWithObjects:computer1, computer2, computer3, nil]]; children:[NSArray arrayWithObjects:computer1, computer2, computer3, nil]];
self.allAreaData = [NSMutableArray arrayWithObjects:huadong ,huabei, jinghu, nil];
self.allAreaData = [NSMutableArray arrayWithObjects:huadong ,huabei, jinghu,nil];
} }
...@@ -98,7 +111,6 @@ ...@@ -98,7 +111,6 @@
- (NSInteger)treeView:(RATreeView *)treeView numberOfChildrenOfItem:(id)item - (NSInteger)treeView:(RATreeView *)treeView numberOfChildrenOfItem:(id)item
{ {
NSInteger level = [treeView levelForCellForItem:item]; NSInteger level = [treeView levelForCellForItem:item];
NSLog(@"11level = %ld", level);
if (level == -1) { if (level == -1) {
return [self.allAreaData count]; return [self.allAreaData count];
} else if (level == 0) { } else if (level == 0) {
...@@ -116,7 +128,6 @@ ...@@ -116,7 +128,6 @@
- (id)treeView:(RATreeView *)treeView child:(NSInteger)index ofItem:(id)item - (id)treeView:(RATreeView *)treeView child:(NSInteger)index ofItem:(id)item
{ {
NSInteger level = [treeView levelForCellForItem:item]; NSInteger level = [treeView levelForCellForItem:item];
NSLog(@"22level = %ld", level);
if (level == -1) { if (level == -1) {
return [self.allAreaData objectAtIndex:index]; return [self.allAreaData objectAtIndex:index];
} else if (level == 0) { } else if (level == 0) {
...@@ -133,50 +144,28 @@ NSLog(@"22level = %ld", level); ...@@ -133,50 +144,28 @@ NSLog(@"22level = %ld", level);
- (UITableViewCell *)treeView:(RATreeView *)treeView cellForItem:(id)item - (UITableViewCell *)treeView:(RATreeView *)treeView cellForItem:(id)item
{ {
NSInteger level = [self.treeView levelForCellForItem:item]; NSInteger level = [self.treeView levelForCellForItem:item];
NSLog(@"33level = %ld", level);
if (level == 0) { if (level == 0) {
AreaModel *data = item; AreaModel *data = item;
NSInteger numberOfChildren = [data.provinceArray count]; SelectAreaTableCell *cell = [self.treeView dequeueReusableCellWithIdentifier:kSelectAreaTableCell];
NSString *detailText = [NSString localizedStringWithFormat:@"Number of children %@ level = %ld", [@(numberOfChildren) stringValue], level]; [cell.checkBoxButton setTitle:data.name forState:UIControlStateNormal];
NSLog(@"check.select = %d", (int)cell.checkBoxButton.selected);
UITableViewCell *cell = [self.treeView dequeueReusableCellWithIdentifier:NSStringFromClass([UITableViewCell class])]; cell.iconImageView.image = [UIImage imageNamed:@"arrow_down"];
cell.contentView.backgroundColor = [UIColor brownColor];
cell.textLabel.text = data.name;
cell.detailTextLabel.text = detailText;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell; return cell;
} else if (level == 1) { } else if (level == 1) {
ProvinceModel *data = item; ProvinceModel *data = item;
NSInteger numberOfChildren = [data.storeArray count]; SelectProvinceTableCell *cell = [self.treeView dequeueReusableCellWithIdentifier:kSelectProvinceTableCell];
NSString *detailText = [NSString localizedStringWithFormat:@"Number of children %@ level = %ld", [@(numberOfChildren) stringValue], level]; [cell.checkBoxButton setTitle:data.name forState:UIControlStateNormal];
cell.iconImageView.image = [UIImage imageNamed:@"grey-trilateral_down"];
UITableViewCell *cell = [self.treeView dequeueReusableCellWithIdentifier:NSStringFromClass([UITableViewCell class])];
cell.contentView.backgroundColor = [UIColor yellowColor];
cell.textLabel.text = data.name;
cell.detailTextLabel.text = detailText;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell; return cell;
} else { } else {
StoreModel *data = item; StoreModel *data = item;
NSInteger numberOfChildren = 0; SelectStoreTableCell *cell = [self.treeView dequeueReusableCellWithIdentifier:kSelectStoreTableCell];
NSString *detailText = [NSString localizedStringWithFormat:@"Number of children %@ level = %ld", [@(numberOfChildren) stringValue], level]; [cell.checkBoxButton setTitle:data.name forState:UIControlStateNormal];
UITableViewCell *cell = [self.treeView dequeueReusableCellWithIdentifier:NSStringFromClass([UITableViewCell class])];
cell.contentView.backgroundColor = [UIColor orangeColor];
cell.textLabel.text = data.name;
cell.detailTextLabel.text = detailText;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell; return cell;
} }
} }
...@@ -195,11 +184,23 @@ NSLog(@"22level = %ld", level); ...@@ -195,11 +184,23 @@ NSLog(@"22level = %ld", level);
_treeView.treeFooterView = [UIView new]; _treeView.treeFooterView = [UIView new];
_treeView.rowHeight = UITableViewAutomaticDimension; _treeView.rowHeight = UITableViewAutomaticDimension;
_treeView.estimatedRowHeight = 150.0; _treeView.estimatedRowHeight = 150.0;
_treeView.treeHeaderView = self.headerView;
[_treeView registerClass:[SelectAreaTableCell class] forCellReuseIdentifier:kSelectAreaTableCell];
[_treeView registerClass:[SelectProvinceTableCell class] forCellReuseIdentifier:kSelectProvinceTableCell];
[_treeView registerClass:[SelectStoreTableCell class] forCellReuseIdentifier:kSelectStoreTableCell];
[self.view addSubview:_treeView]; [self.view addSubview:_treeView];
} }
return _treeView; return _treeView;
} }
- (SelectStoreHeadView *)headerView
{
if (!_headerView) {
_headerView = [[SelectStoreHeadView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 50)];
}
return _headerView;
}
/* /*
#pragma mark - Navigation #pragma mark - Navigation
......
//
// RankScreenTableViewCell.h
// redstar
//
// Created by admin on 15/12/16.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RankScreenTableViewCell : UITableViewCell
@property (nonatomic, strong) UILabel *queryLabel;
@property (nonatomic, strong) UIButton *screenButton;
@end
//
// RankScreenTableViewCell.m
// redstar
//
// Created by admin on 15/12/16.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankScreenTableViewCell.h"
@implementation RankScreenTableViewCell
- (UILabel *)queryLabel
{
if (!_queryLabel) {
_queryLabel = [[UILabel alloc] init];
_queryLabel.translatesAutoresizingMaskIntoConstraints = NO;
_queryLabel.textAlignment = NSTextAlignmentLeft;
[self.contentView addSubview:_queryLabel];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_queryLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_queryLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_queryLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.screenButton attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_queryLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:55];
[self.contentView addConstraint:contentHeight];
NSLayoutConstraint *contentBottom = [NSLayoutConstraint constraintWithItem:_queryLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:contentBottom];
}
return _queryLabel;
}
- (UIButton *)screenButton
{
if (!_screenButton) {
_screenButton = [[UIButton alloc] init];
_screenButton.translatesAutoresizingMaskIntoConstraints = NO;
_screenButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
[_screenButton setTitle:@"确定" forState:UIControlStateNormal];
[_screenButton setTitleColor:kNavigationBarColor forState:UIControlStateNormal];
_screenButton.layer.borderWidth = 1.0;
_screenButton.layer.borderColor = kNavigationBarCGColor;
_screenButton.layer.cornerRadius = 4.0;
[self.contentView addSubview:_screenButton];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_screenButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:10];
[self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentWidth = [NSLayoutConstraint constraintWithItem:_screenButton attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:120];
[self.contentView addConstraint:contentWidth];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_screenButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_screenButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:35];
[self.contentView addConstraint:contentHeight];
}
return _screenButton;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// RankListTableHeaderView.h
// redstar
//
// Created by admin on 15/12/15.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RankListTableHeaderView : UIView
@property (nonatomic, strong) UILabel *praiseLabel;
@property (nonatomic, strong) UILabel *limitsLabel;
@property (nonatomic, strong) UILabel *statisticsLabel;
@end
//
// RankListTableHeaderView.m
// redstar
//
// Created by admin on 15/12/15.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankListTableHeaderView.h"
@implementation RankListTableHeaderView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "DateButton.h" #import "DateButton.h"
@interface RankingListViewController : UIViewController @interface RankingListViewController : UIViewController
@property (nonatomic, strong) UILabel *pointLabel1; // 月度排名 //@property (nonatomic, strong) UILabel *pointLabel1; // 月度排名
@property (nonatomic, strong) UILabel *pointLabel2; // 参与商场数量 //@property (nonatomic, strong) UILabel *pointLabel2; // 参与商场数量
@property (nonatomic, strong) DateButton *dateButton; // 年月日 //@property (nonatomic, strong) DateButton *dateButton; // 年月日
@property (nonatomic, strong) UILabel *shoppingCountLabel; // 商场数 //@property (nonatomic, strong) UILabel *shoppingCountLabel; // 商场数
@property (nonatomic, strong) UIView *lineView; // 分割线 //@property (nonatomic, strong) UIView *lineView; // 分割线
@end @end
...@@ -17,16 +17,26 @@ ...@@ -17,16 +17,26 @@
#import "RankListHeaderView.h" #import "RankListHeaderView.h"
#import "RankCommentCell.h" #import "RankCommentCell.h"
#import "RankScreenTableViewCell.h"
#import <MBProgressHUD.h> #import <MBProgressHUD.h>
#import "OnLineTableViewCell.h"
#import "HomeTitleTableCell.h"
#import "SelectStoreViewController.h"
#define konlineCell @"onlinesTableViewCell"
#define kRankingCell @"RankingTableViewCell" #define kRankingCell @"RankingTableViewCell"
#define kHomeTitleCellInde @"homeTitleCellInde"
#define kRankScreenTableViewCell @"rankingScreenCell"
#define kShopNameBtnTag 15000 #define kShopNameBtnTag 15000
@interface RankingListViewController () <UITableViewDataSource, UITableViewDelegate, RankListHeaderDelegate> @interface RankingListViewController () <UITableViewDataSource, UITableViewDelegate, RankListHeaderDelegate>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UIView *headView; //@property (nonatomic, strong) UIView *headView;
@property (nonatomic, strong) UIView *lineView1; //@property (nonatomic, strong) UIView *lineView1;
@property (nonatomic, strong) NSMutableArray *allRankListArray; @property (nonatomic, strong) NSMutableArray *allRankListArray;
@property (nonatomic, strong) NoDataView *noDataView; @property (nonatomic, strong) NoDataView *noDataView;
...@@ -36,6 +46,7 @@ ...@@ -36,6 +46,7 @@
@property (nonatomic, strong) UILabel *gradeLabel; @property (nonatomic, strong) UILabel *gradeLabel;
@property (nonatomic, strong) NSArray *rankData; @property (nonatomic, strong) NSArray *rankData;
@property (nonatomic, strong) NSArray *allTitleArray;
@end @end
...@@ -45,6 +56,8 @@ ...@@ -45,6 +56,8 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.allTitleArray = [NSArray arrayWithObjects:@"口碑巡检", @"选择范围", @"统计方式" ,nil];
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)]; UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
...@@ -70,7 +83,6 @@ ...@@ -70,7 +83,6 @@
[self addTableViews];
[self requestRankingList]; [self requestRankingList];
...@@ -129,11 +141,6 @@ ...@@ -129,11 +141,6 @@
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
NSString *shopCount = [NSString stringWithFormat:@"%lu 家", (unsigned long)_rankData.count];
NSMutableAttributedString *shopAttr = [[NSMutableAttributedString alloc] initWithString:shopCount];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:kShopCountTextColor,NSFontAttributeName:[UIFont systemFontOfSize:21.0f]} range:NSMakeRange(0,shopCount.length - 2)];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(shopCount.length - 2,2)];
_shoppingCountLabel.attributedText = shopAttr;
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
} }
...@@ -153,15 +160,6 @@ ...@@ -153,15 +160,6 @@
[self.navigationController dismissViewControllerAnimated:YES completion:nil]; [self.navigationController dismissViewControllerAnimated:YES completion:nil];
} }
- (void)addTableViews
{
self.pointLabel1.text = @"月度排名";
self.lineView.backgroundColor = kSeparateLineColor;
self.pointLabel2.text = @"参与商家数量";
self.lineView1.backgroundColor = kSeparateLineColor;
self.shoppingCountLabel.textAlignment = NSTextAlignmentCenter;
[self.dateButton addTarget:self action:@selector(changeDateClick:) forControlEvents:UIControlEventTouchUpInside];
}
- (void)changeDateClick:(DateButton *)sender - (void)changeDateClick:(DateButton *)sender
{ {
...@@ -173,40 +171,98 @@ ...@@ -173,40 +171,98 @@
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{ {
return _rankData.count; return _rankData.count + 1;
} }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
RankListModel *rankList = _rankData[section]; if (section == 0) {
NSInteger count = rankList.isOpened ? rankList.comments.count: 0; return 5;
return count; } else {
RankListModel *rankList = _rankData[section - 1];
NSInteger count = rankList.isOpened ? rankList.comments.count: 0;
return count;
}
} }
// cell显示的内容 // cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
RankCommentCell *cell=[tableView dequeueReusableCellWithIdentifier:kRankingCell];
if (!cell) {
cell = [[RankCommentCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kRankingCell]; if (indexPath.section == 0) {
if (indexPath.row < 3) {
OnLineTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:konlineCell];
if (!cell) {
cell = [[OnLineTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:konlineCell];
}
cell.titleLabel.text = _allTitleArray[indexPath.row];
if (indexPath.row < 2) {
cell.selectLabel.text = @"2015年10月口碑检查";
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else {
[cell.storeBtn setTitle:@"商场得分" forState:UIControlStateNormal];
[cell.averageBtn setTitle:@"区域平均分" forState:UIControlStateNormal];
}
return cell;
} else if (indexPath.row == 3){
RankScreenTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kRankScreenTableViewCell];
if (!cell) {
cell = [[RankScreenTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kRankScreenTableViewCell];
}
NSString *queryStr = [NSString stringWithFormat:@"查询结果共计 %ld 家", (unsigned long)_rankData.count];
NSMutableAttributedString *queryAttr = [[NSMutableAttributedString alloc] initWithString:queryStr];
[queryAttr addAttributes:@{NSForegroundColorAttributeName:kLightGray,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,7)];
[queryAttr addAttributes:@{NSForegroundColorAttributeName:kNavigationBarColor,NSFontAttributeName:[UIFont systemFontOfSize:20.0f]} range:NSMakeRange(7,queryStr.length - 9)];
[queryAttr addAttributes:@{NSForegroundColorAttributeName:kLightGray,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(queryStr.length - 1,1)];
[cell.queryLabel setAttributedText:queryAttr];
[cell.screenButton addTarget:self action:@selector(clickHeadView) forControlEvents:UIControlEventTouchUpInside];
return cell;
} else {
HomeTitleTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeTitleCellInde];
if (!cell) {
cell = [[HomeTitleTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeTitleCellInde];
}
cell.contentView.backgroundColor = kSectionBackGroundColor;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
} else {
RankCommentCell *cell=[tableView dequeueReusableCellWithIdentifier:kRankingCell];
if (!cell) {
cell = [[RankCommentCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kRankingCell];
}
RankListModel *rankListModel = _rankData[indexPath.section];
RankCommentModel *commentModel = rankListModel.comments[indexPath.row];
cell.rankComment = commentModel;
return cell;
} }
RankListModel *rankListModel = _rankData[indexPath.section];
RankCommentModel *commentModel = rankListModel.comments[indexPath.row];
cell.rankComment = commentModel;
return cell;
} }
// cell的点击事件 // cell的点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
RankListModel *rankList = _rankData[indexPath.section]; if (indexPath.section == 0) {
if (indexPath.row == 0) {
RankDetailViewController *rankDetailVC = [[RankDetailViewController alloc] init];
rankDetailVC.indexRow = indexPath.section; } else if (indexPath.row == 1) {
rankDetailVC.uuid = rankList.uuid; SelectStoreViewController *select = [[SelectStoreViewController alloc] init];
rankDetailVC.store_uuid = rankList.store_uuid; [self.navigationController pushViewController:select animated:YES];
rankDetailVC.storeAddress = rankList.storeAddress; } else {
rankDetailVC.storePictures = rankList.storePictures; return;
[self.navigationController pushViewController:rankDetailVC animated:YES]; }
} else {
RankListModel *rankList = _rankData[indexPath.section - 1];
RankDetailViewController *rankDetailVC = [[RankDetailViewController alloc] init];
rankDetailVC.indexRow = indexPath.section;
rankDetailVC.uuid = rankList.uuid;
rankDetailVC.store_uuid = rankList.store_uuid;
rankDetailVC.storeAddress = rankList.storeAddress;
rankDetailVC.storePictures = rankList.storePictures;
[self.navigationController pushViewController:rankDetailVC animated:YES];
}
} }
// cell的高度 // cell的高度
...@@ -214,7 +270,11 @@ ...@@ -214,7 +270,11 @@
// section高度 // section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{ {
return 50; if (section == 0) {
return CGFLOAT_MIN;
} else {
return 50;
}
} }
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
...@@ -225,21 +285,26 @@ ...@@ -225,21 +285,26 @@
// 自定义section // 自定义section
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{ {
RankListHeaderView *headView = [RankListHeaderView headViewWithTableView:tableView section:section]; if (section == 0) {
headView.delegate = self; return nil;
[headView.pushButton addTarget:self action:@selector(pushclick:) forControlEvents:UIControlEventTouchUpInside]; } else {
headView.rankListModel = _rankData[section];
return headView; RankListHeaderView *headView = [RankListHeaderView headViewWithTableView:tableView section:section];
headView.delegate = self;
[headView.pushButton addTarget:self action:@selector(pushclick:) forControlEvents:UIControlEventTouchUpInside];
headView.rankListModel = _rankData[section - 1];
return headView;
}
} }
- (void)pushclick:(UIButton *)sender - (void)pushclick:(UIButton *)sender
{ {
NSInteger section = sender.tag - kPushTag; NSInteger section = sender.tag - kPushTag;
RankListModel *rankList = _rankData[section]; RankListModel *rankList = _rankData[section - 1];
RankDetailViewController *rankDetailVC = [[RankDetailViewController alloc] init]; RankDetailViewController *rankDetailVC = [[RankDetailViewController alloc] init];
rankDetailVC.indexRow = section; rankDetailVC.indexRow = section - 1;
rankDetailVC.uuid = rankList.uuid; rankDetailVC.uuid = rankList.uuid;
rankDetailVC.store_uuid = rankList.store_uuid; rankDetailVC.store_uuid = rankList.store_uuid;
rankDetailVC.storeAddress = rankList.storeAddress; rankDetailVC.storeAddress = rankList.storeAddress;
...@@ -250,247 +315,247 @@ ...@@ -250,247 +315,247 @@
#pragma mark - lazy loading #pragma mark - lazy loading
- (UILabel *)pointLabel1 //- (UILabel *)pointLabel1
{ //{
if (!_pointLabel1) { // if (!_pointLabel1) {
_pointLabel1 = [[UILabel alloc] init]; // _pointLabel1 = [[UILabel alloc] init];
_pointLabel1.translatesAutoresizingMaskIntoConstraints = NO; // _pointLabel1.translatesAutoresizingMaskIntoConstraints = NO;
_pointLabel1.textColor = kRankHeadTitleTextColor; // _pointLabel1.textColor = kRankHeadTitleTextColor;
_pointLabel1.font = [UIFont systemFontOfSize:15.0]; // _pointLabel1.font = [UIFont systemFontOfSize:15.0];
_pointLabel1.textAlignment = NSTextAlignmentCenter; // _pointLabel1.textAlignment = NSTextAlignmentCenter;
[self.headView addSubview:_pointLabel1]; // [self.headView addSubview:_pointLabel1];
//
NSLayoutConstraint *point1Top = [NSLayoutConstraint constraintWithItem:_pointLabel1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:7]; // NSLayoutConstraint *point1Top = [NSLayoutConstraint constraintWithItem:_pointLabel1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:7];
[self.headView addConstraint:point1Top]; // [self.headView addConstraint:point1Top];
//
NSLayoutConstraint *point1Right = [NSLayoutConstraint constraintWithItem:_pointLabel1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:15]; // NSLayoutConstraint *point1Right = [NSLayoutConstraint constraintWithItem:_pointLabel1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:15];
[self.headView addConstraint:point1Right]; // [self.headView addConstraint:point1Right];
//
NSLayoutConstraint *point1Left = [NSLayoutConstraint constraintWithItem:_pointLabel1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; // NSLayoutConstraint *point1Left = [NSLayoutConstraint constraintWithItem:_pointLabel1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.headView addConstraint:point1Left]; // [self.headView addConstraint:point1Left];
//
NSLayoutConstraint *point1Height = [NSLayoutConstraint constraintWithItem:_pointLabel1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30]; // NSLayoutConstraint *point1Height = [NSLayoutConstraint constraintWithItem:_pointLabel1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.headView addConstraint:point1Height]; // [self.headView addConstraint:point1Height];
} // }
return _pointLabel1; // return _pointLabel1;
} //}
//
- (UIView *)lineView //- (UIView *)lineView
{ //{
if (!_lineView) { // if (!_lineView) {
_lineView = [[UIView alloc] init]; // _lineView = [[UIView alloc] init];
_lineView.translatesAutoresizingMaskIntoConstraints = NO; // _lineView.translatesAutoresizingMaskIntoConstraints = NO;
[self.headView addSubview:_lineView]; // [self.headView addSubview:_lineView];
//
NSLayoutConstraint *point1Top = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:10]; // NSLayoutConstraint *point1Top = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:10];
[self.headView addConstraint:point1Top]; // [self.headView addConstraint:point1Top];
//
//
//
NSLayoutConstraint *point1Left = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.pointLabel1 attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; // NSLayoutConstraint *point1Left = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.pointLabel1 attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.headView addConstraint:point1Left]; // [self.headView addConstraint:point1Left];
//
NSLayoutConstraint *point1Height = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]; // NSLayoutConstraint *point1Height = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50];
[self.headView addConstraint:point1Height]; // [self.headView addConstraint:point1Height];
//
NSLayoutConstraint *point1Width = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0.5]; // NSLayoutConstraint *point1Width = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0.5];
[self.headView addConstraint:point1Width]; // [self.headView addConstraint:point1Width];
//
} // }
return _lineView; // return _lineView;
} //}
//
//
- (UILabel *)pointLabel2 //- (UILabel *)pointLabel2
{ //{
if (!_pointLabel2) { // if (!_pointLabel2) {
_pointLabel2 = [[UILabel alloc] init]; // _pointLabel2 = [[UILabel alloc] init];
_pointLabel2.translatesAutoresizingMaskIntoConstraints = NO; // _pointLabel2.translatesAutoresizingMaskIntoConstraints = NO;
_pointLabel2.textColor = kRankHeadTitleTextColor; // _pointLabel2.textColor = kRankHeadTitleTextColor;
_pointLabel2.font = [UIFont systemFontOfSize:15.0]; // _pointLabel2.font = [UIFont systemFontOfSize:15.0];
_pointLabel2.textAlignment = NSTextAlignmentCenter; // _pointLabel2.textAlignment = NSTextAlignmentCenter;
[self.headView addSubview:_pointLabel2]; // [self.headView addSubview:_pointLabel2];
//
NSLayoutConstraint *point1Top = [NSLayoutConstraint constraintWithItem:_pointLabel2 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:7]; // NSLayoutConstraint *point1Top = [NSLayoutConstraint constraintWithItem:_pointLabel2 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:7];
[self.headView addConstraint:point1Top]; // [self.headView addConstraint:point1Top];
//
NSLayoutConstraint *point1Right = [NSLayoutConstraint constraintWithItem:_pointLabel2 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-(kScreenWidth / 2 - 15 - 90) / 2]; // NSLayoutConstraint *point1Right = [NSLayoutConstraint constraintWithItem:_pointLabel2 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-(kScreenWidth / 2 - 15 - 90) / 2];
[self.headView addConstraint:point1Right]; // [self.headView addConstraint:point1Right];
//
//
NSLayoutConstraint *point1Height = [NSLayoutConstraint constraintWithItem:_pointLabel2 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30]; // NSLayoutConstraint *point1Height = [NSLayoutConstraint constraintWithItem:_pointLabel2 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.headView addConstraint:point1Height]; // [self.headView addConstraint:point1Height];
} // }
return _pointLabel2; // return _pointLabel2;
} //}
//
//
- (DateButton *)dateButton //- (DateButton *)dateButton
{ //{
if (!_dateButton) { // if (!_dateButton) {
_dateButton = [[DateButton alloc] init]; // _dateButton = [[DateButton alloc] init];
_dateButton.translatesAutoresizingMaskIntoConstraints = NO; // _dateButton.translatesAutoresizingMaskIntoConstraints = NO;
//
NSString *dateStr = [NSString stringWithFormat:@"2015 年 08 月"]; // NSString *dateStr = [NSString stringWithFormat:@"2015 年 08 月"];
NSMutableAttributedString *dateAttr = [[NSMutableAttributedString alloc] initWithString:dateStr]; // NSMutableAttributedString *dateAttr = [[NSMutableAttributedString alloc] initWithString:dateStr];
[dateAttr addAttributes:@{NSForegroundColorAttributeName:kDateButtonTextColor,NSFontAttributeName:[UIFont systemFontOfSize:21.0f]} range:NSMakeRange(0,5)]; // [dateAttr addAttributes:@{NSForegroundColorAttributeName:kDateButtonTextColor,NSFontAttributeName:[UIFont systemFontOfSize:21.0f]} range:NSMakeRange(0,5)];
[dateAttr addAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(5,1)]; // [dateAttr addAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(5,1)];
[dateAttr addAttributes:@{NSForegroundColorAttributeName:kDateButtonTextColor,NSFontAttributeName:[UIFont systemFontOfSize:21.0f]} range:NSMakeRange(6,4)]; // [dateAttr addAttributes:@{NSForegroundColorAttributeName:kDateButtonTextColor,NSFontAttributeName:[UIFont systemFontOfSize:21.0f]} range:NSMakeRange(6,4)];
[dateAttr addAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(10,1)]; // [dateAttr addAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(10,1)];
[_dateButton setAttributedTitle:dateAttr forState:UIControlStateNormal]; // [_dateButton setAttributedTitle:dateAttr forState:UIControlStateNormal];
//
[self.headView addSubview:_dateButton]; // [self.headView addSubview:_dateButton];
//
NSLayoutConstraint *dateTop = [NSLayoutConstraint constraintWithItem:_dateButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.pointLabel1 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; // NSLayoutConstraint *dateTop = [NSLayoutConstraint constraintWithItem:_dateButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.pointLabel1 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.headView addConstraint:dateTop]; // [self.headView addConstraint:dateTop];
//
NSLayoutConstraint *dateLeft = [NSLayoutConstraint constraintWithItem:_dateButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.pointLabel1 attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-70]; // NSLayoutConstraint *dateLeft = [NSLayoutConstraint constraintWithItem:_dateButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.pointLabel1 attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-70];
[self.headView addConstraint:dateLeft]; // [self.headView addConstraint:dateLeft];
//
NSLayoutConstraint *dateWidth = [NSLayoutConstraint constraintWithItem:_dateButton attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:150]; // NSLayoutConstraint *dateWidth = [NSLayoutConstraint constraintWithItem:_dateButton attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:150];
[self.headView addConstraint:dateWidth]; // [self.headView addConstraint:dateWidth];
//
NSLayoutConstraint *dateHeight = [NSLayoutConstraint constraintWithItem:_dateButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30]; // NSLayoutConstraint *dateHeight = [NSLayoutConstraint constraintWithItem:_dateButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[_dateButton addConstraint:dateHeight]; // [_dateButton addConstraint:dateHeight];
} // }
return _dateButton; // return _dateButton;
} //}
//
- (UILabel *)shoppingCountLabel //- (UILabel *)shoppingCountLabel
{ //{
if (!_shoppingCountLabel) { // if (!_shoppingCountLabel) {
_shoppingCountLabel = [[UILabel alloc] init]; // _shoppingCountLabel = [[UILabel alloc] init];
_shoppingCountLabel.translatesAutoresizingMaskIntoConstraints = NO; // _shoppingCountLabel.translatesAutoresizingMaskIntoConstraints = NO;
//
[self.headView addSubview:_shoppingCountLabel]; // [self.headView addSubview:_shoppingCountLabel];
//
NSLayoutConstraint *shoppingCountTop = [NSLayoutConstraint constraintWithItem:_shoppingCountLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.pointLabel2 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; // NSLayoutConstraint *shoppingCountTop = [NSLayoutConstraint constraintWithItem:_shoppingCountLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.pointLabel2 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.headView addConstraint:shoppingCountTop]; // [self.headView addConstraint:shoppingCountTop];
//
NSLayoutConstraint *shoppingCountRight = [NSLayoutConstraint constraintWithItem:_shoppingCountLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-(kScreenWidth / 2 - 60) / 2]; // NSLayoutConstraint *shoppingCountRight = [NSLayoutConstraint constraintWithItem:_shoppingCountLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-(kScreenWidth / 2 - 60) / 2];
[self.headView addConstraint:shoppingCountRight]; // [self.headView addConstraint:shoppingCountRight];
//
NSLayoutConstraint *shoppingCountHeight = [NSLayoutConstraint constraintWithItem:_shoppingCountLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30]; // NSLayoutConstraint *shoppingCountHeight = [NSLayoutConstraint constraintWithItem:_shoppingCountLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[_shoppingCountLabel addConstraint:shoppingCountHeight]; // [_shoppingCountLabel addConstraint:shoppingCountHeight];
} // }
return _shoppingCountLabel; // return _shoppingCountLabel;
} //}
//
//
- (UIView *)lineView1 //- (UIView *)lineView1
{ //{
if (!_lineView1) { // if (!_lineView1) {
_lineView1 = [[UIView alloc] init]; // _lineView1 = [[UIView alloc] init];
_lineView1.translatesAutoresizingMaskIntoConstraints = NO; // _lineView1.translatesAutoresizingMaskIntoConstraints = NO;
[self.headView addSubview:_lineView1]; // [self.headView addSubview:_lineView1];
//
NSLayoutConstraint *lineBottom = [NSLayoutConstraint constraintWithItem:_lineView1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:75]; // NSLayoutConstraint *lineBottom = [NSLayoutConstraint constraintWithItem:_lineView1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:75];
[self.headView addConstraint:lineBottom]; // [self.headView addConstraint:lineBottom];
//
NSLayoutConstraint *lineLeft = [NSLayoutConstraint constraintWithItem:_lineView1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; // NSLayoutConstraint *lineLeft = [NSLayoutConstraint constraintWithItem:_lineView1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.headView addConstraint:lineLeft]; // [self.headView addConstraint:lineLeft];
//
NSLayoutConstraint *lineRight = [NSLayoutConstraint constraintWithItem:_lineView1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; // NSLayoutConstraint *lineRight = [NSLayoutConstraint constraintWithItem:_lineView1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.headView addConstraint:lineRight]; // [self.headView addConstraint:lineRight];
//
NSLayoutConstraint *lineHeight = [NSLayoutConstraint constraintWithItem:_lineView1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:1]; // NSLayoutConstraint *lineHeight = [NSLayoutConstraint constraintWithItem:_lineView1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:1];
[_lineView1 addConstraint:lineHeight]; // [_lineView1 addConstraint:lineHeight];
} // }
return _lineView1; // return _lineView1;
} //}
//
- (UIView *)headView //- (UIView *)headView
{ //{
if (!_headView) { // if (!_headView) {
_headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 116)]; // _headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 116)];
_headView.backgroundColor = [UIColor whiteColor]; // _headView.backgroundColor = [UIColor whiteColor];
} // }
return _headView; // return _headView;
} //}
- (UILabel *)shoppingLabel //- (UILabel *)shoppingLabel
{ //{
if (!_shoppingLabel) { // if (!_shoppingLabel) {
// 商场 // // 商场
_shoppingLabel = [[UILabel alloc] init]; // _shoppingLabel = [[UILabel alloc] init];
_shoppingLabel.textAlignment = NSTextAlignmentCenter; // _shoppingLabel.textAlignment = NSTextAlignmentCenter;
_shoppingLabel.textColor = kRankHeadTitleTextColor; // _shoppingLabel.textColor = kRankHeadTitleTextColor;
_shoppingLabel.backgroundColor = kSectionBackGroundColor; // _shoppingLabel.backgroundColor = kSectionBackGroundColor;
//
_shoppingLabel.font = [UIFont systemFontOfSize:17.0]; // _shoppingLabel.font = [UIFont systemFontOfSize:17.0];
_shoppingLabel.translatesAutoresizingMaskIntoConstraints = NO; // _shoppingLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.headView addSubview:_shoppingLabel]; // [self.headView addSubview:_shoppingLabel];
//
// // //
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:76]; // NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:76];
[self.headView addConstraint:shoppingTop]; // [self.headView addConstraint:shoppingTop];
//
NSLayoutConstraint *shoppingLeft = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; // NSLayoutConstraint *shoppingLeft = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.headView addConstraint:shoppingLeft]; // [self.headView addConstraint:shoppingLeft];
//
NSLayoutConstraint *shoppingRight = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.scoreLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; // NSLayoutConstraint *shoppingRight = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.scoreLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.headView addConstraint:shoppingRight]; // [self.headView addConstraint:shoppingRight];
//
NSLayoutConstraint *shoppingBottom = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; // NSLayoutConstraint *shoppingBottom = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.headView addConstraint:shoppingBottom]; // [self.headView addConstraint:shoppingBottom];
//
NSLayoutConstraint *shoppingWidth = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.scoreLabel attribute:NSLayoutAttributeWidth multiplier:1.2 constant:0]; // NSLayoutConstraint *shoppingWidth = [NSLayoutConstraint constraintWithItem:_shoppingLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.scoreLabel attribute:NSLayoutAttributeWidth multiplier:1.2 constant:0];
[self.headView addConstraint:shoppingWidth]; // [self.headView addConstraint:shoppingWidth];
} // }
return _shoppingLabel; // return _shoppingLabel;
} //}
//
- (UILabel *)scoreLabel //- (UILabel *)scoreLabel
{ //{
if (!_scoreLabel) { // if (!_scoreLabel) {
_scoreLabel = [[UILabel alloc] init]; // _scoreLabel = [[UILabel alloc] init];
_scoreLabel.textAlignment = NSTextAlignmentCenter; // _scoreLabel.textAlignment = NSTextAlignmentCenter;
_scoreLabel.textColor = kRankHeadTitleTextColor; // _scoreLabel.textColor = kRankHeadTitleTextColor;
_scoreLabel.backgroundColor = kSectionBackGroundColor; // _scoreLabel.backgroundColor = kSectionBackGroundColor;
_scoreLabel.font = [UIFont systemFontOfSize:17.0]; // _scoreLabel.font = [UIFont systemFontOfSize:17.0];
_scoreLabel.translatesAutoresizingMaskIntoConstraints = NO; // _scoreLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.headView addSubview:_scoreLabel]; // [self.headView addSubview:_scoreLabel];
//
// // //
NSLayoutConstraint *scoreTop = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:76]; // NSLayoutConstraint *scoreTop = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:76];
[self.headView addConstraint:scoreTop]; // [self.headView addConstraint:scoreTop];
//
NSLayoutConstraint *scoreRight = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.gradeLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; // NSLayoutConstraint *scoreRight = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.gradeLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.headView addConstraint:scoreRight]; // [self.headView addConstraint:scoreRight];
//
NSLayoutConstraint *scoreWidth = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.gradeLabel attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0]; // NSLayoutConstraint *scoreWidth = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.gradeLabel attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.headView addConstraint:scoreWidth]; // [self.headView addConstraint:scoreWidth];
//
NSLayoutConstraint *scoreBottom = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; // NSLayoutConstraint *scoreBottom = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.headView addConstraint:scoreBottom]; // [self.headView addConstraint:scoreBottom];
} // }
return _scoreLabel; // return _scoreLabel;
} //}
//
- (UILabel *)gradeLabel //- (UILabel *)gradeLabel
{ //{
if (!_gradeLabel) { // if (!_gradeLabel) {
_gradeLabel = [[UILabel alloc] init]; // _gradeLabel = [[UILabel alloc] init];
_gradeLabel.textAlignment = NSTextAlignmentCenter; // _gradeLabel.textAlignment = NSTextAlignmentCenter;
_gradeLabel.textColor = kRankHeadTitleTextColor; // _gradeLabel.textColor = kRankHeadTitleTextColor;
_gradeLabel.font = [UIFont systemFontOfSize:17.0]; // _gradeLabel.font = [UIFont systemFontOfSize:17.0];
_gradeLabel.translatesAutoresizingMaskIntoConstraints = NO; // _gradeLabel.translatesAutoresizingMaskIntoConstraints = NO;
_gradeLabel.backgroundColor = kSectionBackGroundColor; // _gradeLabel.backgroundColor = kSectionBackGroundColor;
//
[self.headView addSubview:_gradeLabel]; // [self.headView addSubview:_gradeLabel];
//
// // //
NSLayoutConstraint *gradeTop = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:76]; // NSLayoutConstraint *gradeTop = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeTop multiplier:1.0 constant:76];
[self.headView addConstraint:gradeTop]; // [self.headView addConstraint:gradeTop];
//
NSLayoutConstraint *gradeRight = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; // NSLayoutConstraint *gradeRight = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.headView addConstraint:gradeRight]; // [self.headView addConstraint:gradeRight];
//
NSLayoutConstraint *gradeBottom = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; // NSLayoutConstraint *gradeBottom = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.headView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.headView addConstraint:gradeBottom]; // [self.headView addConstraint:gradeBottom];
} // }
return _gradeLabel; // return _gradeLabel;
} //}
...@@ -512,7 +577,11 @@ ...@@ -512,7 +577,11 @@
_tableView.rowHeight = UITableViewAutomaticDimension; _tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 100.0; _tableView.estimatedRowHeight = 100.0;
[_tableView registerClass:[RankCommentCell class] forCellReuseIdentifier:kRankingCell]; [_tableView registerClass:[RankCommentCell class] forCellReuseIdentifier:kRankingCell];
_tableView.tableHeaderView = self.headView; [_tableView registerClass:[OnLineTableViewCell class] forCellReuseIdentifier:konlineCell];
[_tableView registerClass:[RankScreenTableViewCell class] forCellReuseIdentifier:kRankScreenTableViewCell];
[_tableView registerClass:[HomeTitleTableCell class] forCellReuseIdentifier:kHomeTitleCellInde];
_tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, CGFLOAT_MIN)];
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
// 商场 // 商场
UILabel *shoppingLabel = [[UILabel alloc] init]; UILabel *shoppingLabel = [[UILabel alloc] init];
shoppingLabel.text = @"商场名称"; shoppingLabel.text = @"商场名称";
shoppingLabel.backgroundColor = [UIColor clearColor];
shoppingLabel.textAlignment = NSTextAlignmentCenter; shoppingLabel.textAlignment = NSTextAlignmentCenter;
shoppingLabel.textColor = kRankHeadTitleTextColor; shoppingLabel.textColor = kRankHeadTitleTextColor;
shoppingLabel.font = [UIFont systemFontOfSize:17.0]; shoppingLabel.font = [UIFont systemFontOfSize:17.0];
...@@ -32,6 +33,8 @@ ...@@ -32,6 +33,8 @@
// 总分 // 总分
UILabel *scoreLabel = [[UILabel alloc] init]; UILabel *scoreLabel = [[UILabel alloc] init];
scoreLabel.text = @"总分"; scoreLabel.text = @"总分";
scoreLabel.backgroundColor = [UIColor clearColor];
scoreLabel.textAlignment = NSTextAlignmentCenter; scoreLabel.textAlignment = NSTextAlignmentCenter;
scoreLabel.textColor = kRankHeadTitleTextColor; scoreLabel.textColor = kRankHeadTitleTextColor;
scoreLabel.font = [UIFont systemFontOfSize:17.0]; scoreLabel.font = [UIFont systemFontOfSize:17.0];
...@@ -41,6 +44,7 @@ ...@@ -41,6 +44,7 @@
// 排名 // 排名
UILabel *gradeLabel = [[UILabel alloc] init]; UILabel *gradeLabel = [[UILabel alloc] init];
gradeLabel.text = @"排名"; gradeLabel.text = @"排名";
gradeLabel.backgroundColor = [UIColor clearColor];
gradeLabel.textAlignment = NSTextAlignmentCenter; gradeLabel.textAlignment = NSTextAlignmentCenter;
gradeLabel.textColor = kRankHeadTitleTextColor; gradeLabel.textColor = kRankHeadTitleTextColor;
gradeLabel.font = [UIFont systemFontOfSize:17.0]; gradeLabel.font = [UIFont systemFontOfSize:17.0];
...@@ -48,7 +52,7 @@ ...@@ -48,7 +52,7 @@
[self.contentView addSubview:gradeLabel]; [self.contentView addSubview:gradeLabel];
// //
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:shoppingLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5]; NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:shoppingLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:3];
[self.contentView addConstraint:shoppingTop]; [self.contentView addConstraint:shoppingTop];
NSLayoutConstraint *shoppingLeft = [NSLayoutConstraint constraintWithItem:shoppingLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *shoppingLeft = [NSLayoutConstraint constraintWithItem:shoppingLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
...@@ -64,7 +68,7 @@ ...@@ -64,7 +68,7 @@
[self.contentView addConstraint:shoppingWidth]; [self.contentView addConstraint:shoppingWidth];
// //
NSLayoutConstraint *scoreTop = [NSLayoutConstraint constraintWithItem:scoreLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5]; NSLayoutConstraint *scoreTop = [NSLayoutConstraint constraintWithItem:scoreLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:3];
[self.contentView addConstraint:scoreTop]; [self.contentView addConstraint:scoreTop];
NSLayoutConstraint *scoreRight = [NSLayoutConstraint constraintWithItem:scoreLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:gradeLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *scoreRight = [NSLayoutConstraint constraintWithItem:scoreLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:gradeLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
...@@ -77,7 +81,7 @@ ...@@ -77,7 +81,7 @@
[self.contentView addConstraint:scoreBottom]; [self.contentView addConstraint:scoreBottom];
// //
NSLayoutConstraint *gradeTop = [NSLayoutConstraint constraintWithItem:gradeLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5]; NSLayoutConstraint *gradeTop = [NSLayoutConstraint constraintWithItem:gradeLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:3];
[self.contentView addConstraint:gradeTop]; [self.contentView addConstraint:gradeTop];
NSLayoutConstraint *gradeRight = [NSLayoutConstraint constraintWithItem:gradeLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; NSLayoutConstraint *gradeRight = [NSLayoutConstraint constraintWithItem:gradeLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment