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
...@@ -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