1
@@ -75,8 +75,10 @@
|
||||
048909F72EC0AAAA00FABA60 /* KBCategoryTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 048909F32EC0AAAA00FABA60 /* KBCategoryTitleView.m */; };
|
||||
04890A042EC0BBBB00FABA60 /* KBCategoryTitleImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 04890A012EC0BBBB00FABA60 /* KBCategoryTitleImageCell.m */; };
|
||||
04890A052EC0BBBB00FABA60 /* KBCategoryTitleImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04890A032EC0BBBB00FABA60 /* KBCategoryTitleImageView.m */; };
|
||||
04890B122EC2F00000FABA60 /* KBMyHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04890B112EC2F00000FABA60 /* KBMyHeaderView.m */; };
|
||||
049FB20B2EC1C13800FAB05D /* KBSkinBottomActionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 049FB20A2EC1C13800FAB05D /* KBSkinBottomActionView.m */; };
|
||||
049FB20E2EC1CD2800FAB05D /* KBAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 049FB20D2EC1CD2800FAB05D /* KBAlert.m */; };
|
||||
049FB2112EC1F72F00FAB05D /* KBMyListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 049FB2102EC1F72F00FAB05D /* KBMyListCell.m */; };
|
||||
04A9FE0F2EB481100020DB6D /* KBHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC97082EB31B14007BD342 /* KBHUD.m */; };
|
||||
04A9FE132EB4D0D20020DB6D /* KBFullAccessManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A9FE112EB4D0D20020DB6D /* KBFullAccessManager.m */; };
|
||||
04A9FE162EB873C80020DB6D /* UIViewController+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A9FE152EB873C80020DB6D /* UIViewController+Extension.m */; };
|
||||
@@ -119,7 +121,6 @@
|
||||
04FC97092EB31B14007BD342 /* KBHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC97082EB31B14007BD342 /* KBHUD.m */; };
|
||||
04FC970E2EB334F8007BD342 /* UIImageView+KBWebImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC970B2EB334F8007BD342 /* UIImageView+KBWebImage.m */; };
|
||||
04FC970F2EB334F8007BD342 /* KBWebImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC970D2EB334F8007BD342 /* KBWebImageManager.m */; };
|
||||
7276DDA82EC1B28300804C36 /* KBWebViewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7276DDA72EC1B28300804C36 /* KBWebViewViewController.m */; };
|
||||
7A36414DFDA5BEC9B7D2E318 /* Pods_CustomKeyboard.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C1092FB2B452F95B15D4263 /* Pods_CustomKeyboard.framework */; };
|
||||
A1B2C3D42EB0A0A100000001 /* KBFunctionTagCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A1B2C3D32EB0A0A100000001 /* KBFunctionTagCell.m */; };
|
||||
A1B2C3E22EB0C0A100000001 /* KBNetworkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A1B2C3E12EB0C0A100000001 /* KBNetworkManager.m */; };
|
||||
@@ -266,10 +267,14 @@
|
||||
04890A012EC0BBBB00FABA60 /* KBCategoryTitleImageCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBCategoryTitleImageCell.m; sourceTree = "<group>"; };
|
||||
04890A022EC0BBBB00FABA60 /* KBCategoryTitleImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBCategoryTitleImageView.h; sourceTree = "<group>"; };
|
||||
04890A032EC0BBBB00FABA60 /* KBCategoryTitleImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBCategoryTitleImageView.m; sourceTree = "<group>"; };
|
||||
04890B102EC2F00000FABA60 /* KBMyHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBMyHeaderView.h; sourceTree = "<group>"; };
|
||||
04890B112EC2F00000FABA60 /* KBMyHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBMyHeaderView.m; sourceTree = "<group>"; };
|
||||
049FB2092EC1C13800FAB05D /* KBSkinBottomActionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinBottomActionView.h; sourceTree = "<group>"; };
|
||||
049FB20A2EC1C13800FAB05D /* KBSkinBottomActionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinBottomActionView.m; sourceTree = "<group>"; };
|
||||
049FB20C2EC1CD2800FAB05D /* KBAlert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBAlert.h; sourceTree = "<group>"; };
|
||||
049FB20D2EC1CD2800FAB05D /* KBAlert.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBAlert.m; sourceTree = "<group>"; };
|
||||
049FB20F2EC1F72F00FAB05D /* KBMyListCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBMyListCell.h; sourceTree = "<group>"; };
|
||||
049FB2102EC1F72F00FAB05D /* KBMyListCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBMyListCell.m; sourceTree = "<group>"; };
|
||||
04A9A67D2EB9E1690023B8F4 /* KBResponderUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBResponderUtils.h; sourceTree = "<group>"; };
|
||||
04A9FE102EB4D0D20020DB6D /* KBFullAccessManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFullAccessManager.h; sourceTree = "<group>"; };
|
||||
04A9FE112EB4D0D20020DB6D /* KBFullAccessManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFullAccessManager.m; sourceTree = "<group>"; };
|
||||
@@ -838,6 +843,10 @@
|
||||
048908EE2EBF861800FABA60 /* KBSkinSectionTitleCell.m */,
|
||||
049FB2092EC1C13800FAB05D /* KBSkinBottomActionView.h */,
|
||||
049FB20A2EC1C13800FAB05D /* KBSkinBottomActionView.m */,
|
||||
04890B102EC2F00000FABA60 /* KBMyHeaderView.h */,
|
||||
04890B112EC2F00000FABA60 /* KBMyHeaderView.m */,
|
||||
049FB20F2EC1F72F00FAB05D /* KBMyListCell.h */,
|
||||
049FB2102EC1F72F00FAB05D /* KBMyListCell.m */,
|
||||
);
|
||||
path = V;
|
||||
sourceTree = "<group>";
|
||||
@@ -1394,6 +1403,7 @@
|
||||
048908FE2EC0CC2400FABA60 /* UIScrollView+KBEmptyView.m in Sources */,
|
||||
04FC970F2EB334F8007BD342 /* KBWebImageManager.m in Sources */,
|
||||
04FC95CF2EB1E7A1007BD342 /* HomeVC.m in Sources */,
|
||||
049FB2112EC1F72F00FAB05D /* KBMyListCell.m in Sources */,
|
||||
A1B2D7022EB8C00100000001 /* KBLangTestVC.m in Sources */,
|
||||
048908DA2EBF61AF00FABA60 /* UICollectionViewLeftAlignedLayout.m in Sources */,
|
||||
04C6EABF2EAF86530089C901 /* main.m in Sources */,
|
||||
@@ -1417,6 +1427,7 @@
|
||||
A1B2C4212EB4B7A100000001 /* KBKeyboardPermissionManager.m in Sources */,
|
||||
0459D1B42EBA284C00F2D189 /* KBSkinCenterVC.m in Sources */,
|
||||
048908E32EBF760000FABA60 /* MySkinCell.m in Sources */,
|
||||
04890B122EC2F00000FABA60 /* KBMyHeaderView.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
6
keyBoard/Assets.xcassets/My/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
22
keyBoard/Assets.xcassets/My/my_agreement_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_agreement_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_agreement_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_agreement_icon.imageset/my_agreement_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
keyBoard/Assets.xcassets/My/my_agreement_icon.imageset/my_agreement_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
22
keyBoard/Assets.xcassets/My/my_email_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_email_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_email_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_email_icon.imageset/my_email_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
keyBoard/Assets.xcassets/My/my_email_icon.imageset/my_email_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
22
keyBoard/Assets.xcassets/My/my_feedback_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_feedback_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_feedback_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_feedback_icon.imageset/my_feedback_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
keyBoard/Assets.xcassets/My/my_feedback_icon.imageset/my_feedback_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
22
keyBoard/Assets.xcassets/My/my_head_edite.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_head_edite@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_head_edite@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_head_edite.imageset/my_head_edite@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
keyBoard/Assets.xcassets/My/my_head_edite.imageset/my_head_edite@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
22
keyBoard/Assets.xcassets/My/my_kb_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_kb_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_kb_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_kb_icon.imageset/my_kb_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 453 B |
BIN
keyBoard/Assets.xcassets/My/my_kb_icon.imageset/my_kb_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 657 B |
22
keyBoard/Assets.xcassets/My/my_member_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_member_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_member_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_member_icon.imageset/my_member_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
keyBoard/Assets.xcassets/My/my_member_icon.imageset/my_member_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 171 KiB |
22
keyBoard/Assets.xcassets/My/my_notice_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_notice_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_notice_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_notice_icon.imageset/my_notice_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
keyBoard/Assets.xcassets/My/my_notice_icon.imageset/my_notice_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
22
keyBoard/Assets.xcassets/My/my_privacy_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_privacy_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_privacy_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_privacy_icon.imageset/my_privacy_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
keyBoard/Assets.xcassets/My/my_privacy_icon.imageset/my_privacy_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
22
keyBoard/Assets.xcassets/My/my_recharge_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_recharge_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_recharge_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_recharge_icon.imageset/my_recharge_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
keyBoard/Assets.xcassets/My/my_recharge_icon.imageset/my_recharge_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 195 KiB |
22
keyBoard/Assets.xcassets/My/my_share_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_share_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "my_share_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/My/my_share_icon.imageset/my_share_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
keyBoard/Assets.xcassets/My/my_share_icon.imageset/my_share_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
@@ -179,7 +179,7 @@
|
||||
- (UILabel *)peopleLabel {
|
||||
if (!_peopleLabel) {
|
||||
_peopleLabel = [UILabel new];
|
||||
_peopleLabel.textColor = [UIColor colorWithHex:0x02BEAC];
|
||||
_peopleLabel.textColor = [UIColor colorWithHex:KBColor];
|
||||
_peopleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightRegular];
|
||||
_peopleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_peopleLabel.numberOfLines = 2;
|
||||
|
||||
@@ -445,13 +445,19 @@
|
||||
_dragArrowImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
// 初始在 Short 状态,显示向上的箭头
|
||||
_dragArrowImageView.image = [UIImage imageNamed:@"home_up_arrow"];
|
||||
// 可点击:点击根据箭头方向在“最高/最低”之间切换
|
||||
_dragArrowImageView.userInteractionEnabled = YES;
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(kb_onTapDragArrow)];
|
||||
[_dragArrowImageView addGestureRecognizer:tap];
|
||||
}
|
||||
return _dragArrowImageView;
|
||||
}
|
||||
|
||||
// 根据弹窗展示状态切换箭头图
|
||||
- (void)kb_updateDragArrowForState:(PresentationState)state {
|
||||
NSString *imgName = (state == PresentationStateMedium) ? @"home_down_arrow" : @"home_up_arrow";
|
||||
// 视为“最高态”的状态:Medium 或 Long(当两者高度一致时,库可能标记为 Long)
|
||||
BOOL isAtTop = (state == PresentationStateMedium || state == PresentationStateLong);
|
||||
NSString *imgName = isAtTop ? @"home_down_arrow" : @"home_up_arrow";
|
||||
UIImage *img = [UIImage imageNamed:imgName];
|
||||
if (img && self.dragArrowImageView.image != img) {
|
||||
// 柔和切换,避免频繁拖拽时突兀
|
||||
@@ -464,6 +470,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
/// 点击顶部拖拽方向箭头:
|
||||
/// - 当箭头朝上(当前非最高态),点击切换到最高态(Medium)。
|
||||
/// - 当箭头朝下(当前最高态),点击切换到最低态(Short)。
|
||||
- (void)kb_onTapDragArrow {
|
||||
// 以当前展示状态为准做切换
|
||||
PresentationState state = self.hw_presentationState;
|
||||
BOOL isAtTop = (state == PresentationStateMedium || state == PresentationStateLong);
|
||||
if (isAtTop) {
|
||||
// 已在最高态 -> 切到最低态
|
||||
[self hw_panModalTransitionTo:PresentationStateShort];
|
||||
} else {
|
||||
// 不在最高态 -> 切到最高态
|
||||
[self hw_panModalTransitionTo:PresentationStateMedium];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (UIImageView *)leftBgImageView{
|
||||
if (!_leftBgImageView) {
|
||||
|
||||
22
keyBoard/Class/Me/V/KBMyHeaderView.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// KBMyHeaderView.h
|
||||
// keyBoard
|
||||
//
|
||||
// 顶部头部视图:标题 + 头像行 + 两张卡片
|
||||
// Masonry 约束,懒加载,中文注释
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface KBMyHeaderView : UIView
|
||||
@property (nonatomic, strong, readonly) UILabel *titleLabel; // “Settings” 标题
|
||||
@property (nonatomic, strong, readonly) UIButton *keyboardBtn; // 右上角“ My Keyboard ”按钮
|
||||
@property (nonatomic, strong, readonly) UIImageView *avatarView; // 头像
|
||||
@property (nonatomic, strong, readonly) UILabel *nameLabel; // 名称/提示
|
||||
@property (nonatomic, strong, readonly) UIView *cardLeft; // 左卡片
|
||||
@property (nonatomic, strong, readonly) UIView *cardRight; // 右卡片
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
142
keyBoard/Class/Me/V/KBMyHeaderView.m
Normal file
@@ -0,0 +1,142 @@
|
||||
//
|
||||
// KBMyHeaderView.m
|
||||
// keyBoard
|
||||
//
|
||||
|
||||
#import "KBMyHeaderView.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "UIColor+Extension.h"
|
||||
|
||||
@interface KBMyHeaderView ()
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UIButton *keyboardBtn;
|
||||
@property (nonatomic, strong) UIImageView *avatarView;
|
||||
@property (nonatomic, strong) UILabel *nameLabel;
|
||||
@property (nonatomic, strong) UIImageView *cardLeft;
|
||||
@property (nonatomic, strong) UIImageView *cardRight;
|
||||
@end
|
||||
|
||||
@implementation KBMyHeaderView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
self.backgroundColor = [UIColor colorWithHex:0xF2F6FA]; // 淡色背景
|
||||
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.keyboardBtn];
|
||||
[self addSubview:self.avatarView];
|
||||
[self addSubview:self.nameLabel];
|
||||
[self addSubview:self.cardLeft];
|
||||
[self addSubview:self.cardRight];
|
||||
|
||||
// 布局
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self).offset(26);
|
||||
make.bottom.equalTo(self.avatarView.mas_top).offset(-35); // 顶部安全区下方
|
||||
}];
|
||||
[self.keyboardBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.titleLabel);
|
||||
make.right.equalTo(self).offset(-20);
|
||||
make.height.mas_equalTo(34);
|
||||
make.width.mas_greaterThanOrEqualTo(126);
|
||||
}];
|
||||
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self).offset(26);
|
||||
make.bottom.equalTo(self.cardLeft.mas_top).offset(-23);
|
||||
make.width.height.mas_equalTo(70);
|
||||
}];
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.avatarView);
|
||||
make.left.equalTo(self.avatarView.mas_right).offset(12);
|
||||
make.right.lessThanOrEqualTo(self).offset(-20);
|
||||
}];
|
||||
// 166 99
|
||||
// w ?
|
||||
CGFloat height = 99 * (KB_SCREEN_WIDTH - 2 * 16 - 10) * 0.5 / 166;
|
||||
[self.cardLeft mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self).offset(16);
|
||||
make.bottom.equalTo(self).offset(-30);
|
||||
make.right.equalTo(self.mas_centerX).offset(-5);
|
||||
make.height.mas_equalTo(height);
|
||||
}];
|
||||
[self.cardRight mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self).offset(-16);
|
||||
make.bottom.equalTo(self).offset(-30);
|
||||
make.left.equalTo(self.mas_centerX).offset(5);
|
||||
make.height.equalTo(self.cardLeft);
|
||||
}];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
// 圆角
|
||||
self.avatarView.layer.cornerRadius = self.avatarView.bounds.size.height * 0.5;
|
||||
self.avatarView.layer.masksToBounds = YES;
|
||||
}
|
||||
|
||||
+ (void)kb_applyGradientTo:(UIView *)view colors:(NSArray *)colors {
|
||||
// 删除旧的渐变层,重复 setNeedsLayout 时避免叠加
|
||||
NSMutableArray<CALayer *> *remove = [NSMutableArray array];
|
||||
for (CALayer *l in view.layer.sublayers) {
|
||||
if ([l isKindOfClass:[CAGradientLayer class]]) { [remove addObject:l]; }
|
||||
}
|
||||
for (CALayer *l in remove) { [l removeFromSuperlayer]; }
|
||||
|
||||
CAGradientLayer *g = [CAGradientLayer layer];
|
||||
g.colors = colors;
|
||||
g.startPoint = CGPointMake(0, 0.5);
|
||||
g.endPoint = CGPointMake(1, 0.5);
|
||||
g.frame = view.bounds;
|
||||
[view.layer insertSublayer:g atIndex:0];
|
||||
}
|
||||
|
||||
#pragma mark - Lazy UI
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.text = @"Settings"; // 大标题
|
||||
_titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightBold];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)keyboardBtn {
|
||||
if (!_keyboardBtn) {
|
||||
_keyboardBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_keyboardBtn setTitle:@" My Keyboard " forState:UIControlStateNormal];
|
||||
_keyboardBtn.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightSemibold];
|
||||
[_keyboardBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_keyboardBtn.backgroundColor = [UIColor colorWithHex:KBColor];
|
||||
_keyboardBtn.layer.cornerRadius = 17;
|
||||
_keyboardBtn.layer.masksToBounds = YES;
|
||||
}
|
||||
return _keyboardBtn;
|
||||
}
|
||||
|
||||
- (UIImageView *)avatarView {
|
||||
if (!_avatarView) {
|
||||
_avatarView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"lufei.jpg"]];
|
||||
_avatarView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_avatarView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1.0];
|
||||
}
|
||||
return _avatarView;
|
||||
}
|
||||
|
||||
- (UILabel *)nameLabel {
|
||||
if (!_nameLabel) {
|
||||
_nameLabel = [UILabel new];
|
||||
_nameLabel.text = @"Notice";
|
||||
_nameLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
_nameLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
}
|
||||
return _nameLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)cardLeft { if (!_cardLeft) { _cardLeft = [UIImageView new]; _cardLeft.contentMode = UIViewContentModeScaleAspectFit; _cardLeft.image = [UIImage imageNamed:@"my_member_icon"];} return _cardLeft; }
|
||||
- (UIImageView *)cardRight { if (!_cardRight) { _cardRight = [UIImageView new];_cardRight.contentMode = UIViewContentModeScaleAspectFit; _cardRight.image = [UIImage imageNamed:@"my_recharge_icon"];} return _cardRight; }
|
||||
|
||||
|
||||
@end
|
||||
27
keyBoard/Class/Me/V/KBMyListCell.h
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// KBMyListCell.h
|
||||
// keyBoard
|
||||
//
|
||||
// Created by Mac on 2025/11/10.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "BaseCell.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface KBMyListCell : BaseCell
|
||||
@property (nonatomic, strong) UIView *container; // 卡片容器(做圆角)
|
||||
@property (nonatomic, strong) UIView *iconBg; // 图标圆角底
|
||||
@property (nonatomic, strong) UIImageView *iconView; // 图标
|
||||
@property (nonatomic, strong) UILabel *titleLabel; // 标题
|
||||
@property (nonatomic, strong) UIView *bottomLine; // 分割线(仅上面一组使用)
|
||||
@property (nonatomic, strong) UIImageView *arrowView; // 自定义右箭头
|
||||
- (void)applyCornersWithFirst:(BOOL)isFirst last:(BOOL)isLast; // 组内圆角
|
||||
- (void)setLineHidden:(BOOL)hidden;
|
||||
|
||||
@property (nonatomic, strong) NSDictionary *itemInfoDic; // 自定义右箭头
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
147
keyBoard/Class/Me/V/KBMyListCell.m
Normal file
@@ -0,0 +1,147 @@
|
||||
//
|
||||
// KBMyListCell.m
|
||||
// keyBoard
|
||||
//
|
||||
// Created by Mac on 2025/11/10.
|
||||
//
|
||||
|
||||
#import "KBMyListCell.h"
|
||||
|
||||
@implementation KBMyListCell
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setItemInfoDic:(NSDictionary *)itemInfoDic{
|
||||
_itemInfoDic = itemInfoDic;
|
||||
self.titleLabel.text = itemInfoDic[@"title"];
|
||||
NSString *icon = itemInfoDic[@"icon"];
|
||||
self.iconView.image = [UIImage imageNamed:icon];
|
||||
}
|
||||
|
||||
- (void)setupUI {
|
||||
[super setupUI];
|
||||
self.contentView.backgroundColor = UIColor.clearColor;
|
||||
self.backgroundColor = UIColor.clearColor;
|
||||
[self.contentView addSubview:self.container];
|
||||
[self.container addSubview:self.iconBg];
|
||||
[self.iconBg addSubview:self.iconView];
|
||||
[self.container addSubview:self.titleLabel];
|
||||
[self.container addSubview:self.arrowView];
|
||||
[self.container addSubview:self.bottomLine];
|
||||
|
||||
// 使用自定义 UIImageView 作为右箭头,替代系统的 accessoryType
|
||||
|
||||
[self.container mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.contentView).offset(16);
|
||||
make.right.equalTo(self.contentView).offset(-16);
|
||||
make.top.bottom.equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
[self.iconBg mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.container).offset(16);
|
||||
make.centerY.equalTo(self.container);
|
||||
make.width.height.mas_equalTo(28);
|
||||
}];
|
||||
[self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.equalTo(self.iconBg);
|
||||
make.width.height.mas_equalTo(24);
|
||||
}];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.iconBg.mas_right).offset(12);
|
||||
make.centerY.equalTo(self.container);
|
||||
// 标题与右箭头保持间距,避免文本被遮挡
|
||||
make.right.lessThanOrEqualTo(self.arrowView.mas_left).offset(-12);
|
||||
}];
|
||||
[self.arrowView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.container);
|
||||
make.right.equalTo(self.container).offset(-12);
|
||||
make.width.mas_equalTo(8);
|
||||
make.height.mas_equalTo(14);
|
||||
}];
|
||||
[self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.titleLabel);
|
||||
make.right.equalTo(self.container).offset(-12);
|
||||
make.bottom.equalTo(self.container);
|
||||
make.height.mas_equalTo(KB_ONE_PIXEL);
|
||||
}];
|
||||
}
|
||||
|
||||
- (UIView *)container {
|
||||
if (!_container) {
|
||||
_container = [UIView new];
|
||||
_container.backgroundColor = [UIColor whiteColor];
|
||||
_container.layer.masksToBounds = YES; // 需要裁剪圆角区域
|
||||
}
|
||||
return _container;
|
||||
}
|
||||
|
||||
- (UIView *)iconBg {
|
||||
if (!_iconBg) {
|
||||
_iconBg = [UIView new];
|
||||
_iconBg.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _iconBg;
|
||||
}
|
||||
|
||||
- (UIImageView *)iconView {
|
||||
if (!_iconView) {
|
||||
_iconView = [[UIImageView alloc] init];
|
||||
}
|
||||
return _iconView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x222222];
|
||||
_titleLabel.text = @"Title";
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)arrowView {
|
||||
if (!_arrowView) {
|
||||
_arrowView = [[UIImageView alloc] init];
|
||||
_arrowView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_arrowView.tintColor = [UIColor colorWithHex:0xC0C0C0];
|
||||
// iOS13+ 使用系统图标,老系统可换成本地资源名
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_arrowView.image = [UIImage systemImageNamed:@"chevron.right"];
|
||||
}
|
||||
}
|
||||
return _arrowView;
|
||||
}
|
||||
|
||||
- (UIView *)bottomLine {
|
||||
if (!_bottomLine) {
|
||||
_bottomLine = [UIView new];
|
||||
_bottomLine.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1.0];
|
||||
}
|
||||
return _bottomLine;
|
||||
}
|
||||
|
||||
- (void)setLineHidden:(BOOL)hidden { self.bottomLine.hidden = hidden; }
|
||||
|
||||
- (void)applyCornersWithFirst:(BOOL)isFirst last:(BOOL)isLast {
|
||||
self.container.layer.cornerRadius = 8;
|
||||
if (@available(iOS 13.0, *)) { self.container.layer.cornerCurve = kCACornerCurveContinuous; }
|
||||
CACornerMask mask = 0;
|
||||
if (isFirst && isLast) {
|
||||
mask = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner | kCALayerMinXMaxYCorner | kCALayerMaxXMaxYCorner;
|
||||
} else if (isFirst) {
|
||||
mask = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
|
||||
} else if (isLast) {
|
||||
mask = kCALayerMinXMaxYCorner | kCALayerMaxXMaxYCorner;
|
||||
} else {
|
||||
mask = 0;
|
||||
}
|
||||
self.container.layer.maskedCorners = mask;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
self.backgroundColor = [UIColor colorWithHex:0x02BEAC];
|
||||
self.backgroundColor = [UIColor colorWithHex:KBColor];
|
||||
self.layer.masksToBounds = YES; // 圆角生效
|
||||
|
||||
// 高亮态轻微透明,突出点击感
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
- (UILabel *)rightLabel {
|
||||
if (!_rightLabel) {
|
||||
_rightLabel = [UILabel new];
|
||||
_rightLabel.textColor = [UIColor colorWithHex:0x02BEAC];
|
||||
_rightLabel.textColor = [UIColor colorWithHex:KBColor];
|
||||
_rightLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
|
||||
_rightLabel.textAlignment = NSTextAlignmentRight;
|
||||
_rightLabel.text = @"Download: 1 Million";
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
- (void)applySelected:(BOOL)selected {
|
||||
self.selectedState = selected;
|
||||
UIColor *fill = selected ? [UIColor colorWithHex:0x02BEAC] : [UIColor colorWithWhite:0 alpha:0.51];
|
||||
UIColor *fill = selected ? [UIColor colorWithHex:KBColor] : [UIColor colorWithWhite:0 alpha:0.51];
|
||||
_circleLayer.fillColor = fill.CGColor; // 选中改为 #02BEAC
|
||||
_checkLayer.hidden = !selected; // 选中显示白对勾
|
||||
}
|
||||
|
||||
@@ -155,9 +155,9 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
BOOL enable = count > 0;
|
||||
self.deleteButton.enabled = enable;
|
||||
if (enable) {
|
||||
self.deleteButton.backgroundColor = [UIColor colorWithHex:0x02BEAC];
|
||||
self.deleteButton.backgroundColor = [UIColor colorWithHex:KBColor];
|
||||
[self.deleteButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
self.deleteButton.layer.borderColor = [UIColor colorWithHex:0x02BEAC].CGColor;
|
||||
self.deleteButton.layer.borderColor = [UIColor colorWithHex:KBColor].CGColor;
|
||||
} else {
|
||||
self.deleteButton.backgroundColor = [UIColor colorWithHex:0xF2F2F2];
|
||||
[self.deleteButton setTitleColor:[UIColor colorWithHex:0xC8C8C8] forState:UIControlStateNormal];
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MyVC : UIViewController
|
||||
@interface MyVC : BaseViewController
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -8,41 +8,101 @@
|
||||
#import "MyVC.h"
|
||||
#import "MySkinVC.h"
|
||||
#import "KBSkinDetailVC.h"
|
||||
#import "KBMyHeaderView.h" // 顶部视图独立封装
|
||||
#import "KBMyListCell.h"
|
||||
|
||||
@interface MyVC ()
|
||||
|
||||
@interface MyVC () <UITableViewDelegate, UITableViewDataSource>
|
||||
@property (nonatomic, strong) BaseTableView *tableView; // 列表
|
||||
@property (nonatomic, strong) KBMyHeaderView *header; // 顶部视图
|
||||
@property (nonatomic, strong) NSArray<NSArray<NSDictionary *> *> *data; // 分组数据
|
||||
@end
|
||||
|
||||
@implementation MyVC
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
|
||||
label.text = @"My";
|
||||
label.textColor = [UIColor darkTextColor];
|
||||
label.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
[label sizeToFit];
|
||||
label.center = self.view.center;
|
||||
label.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
|
||||
[self.view addSubview:label];
|
||||
self.view.backgroundColor = [UIColor colorWithHex:0xF5F7FB];
|
||||
|
||||
// 数据源(title + SF Symbols 名称 + 色值),分两组
|
||||
self.data = @[
|
||||
@[@{ @"title": @"Notice", @"icon": @"my_notice_icon", @"color": @(0x60A3FF) }],
|
||||
@[@{ @"title": @"Share App", @"icon": @"my_share_icon", @"color": @(0xF5A623) }],
|
||||
@[@{ @"title": @"Feedback", @"icon": @"my_feedback_icon", @"color": @(0xB06AFD) },
|
||||
@{ @"title": @"E-mail", @"icon": @"my_email_icon", @"color": @(0xFF8A65) },
|
||||
@{ @"title": @"Agreement", @"icon": @"my_agreement_icon", @"color": @(0x4CD964) },
|
||||
@{ @"title": @"Privacy Policy", @"icon": @"my_privacy_icon", @"color": @(0x5AC8FA) }]
|
||||
];
|
||||
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
|
||||
// tableHeaderView 需要设置 frame,约束不会自动生效
|
||||
self.header = [[KBMyHeaderView alloc] initWithFrame:CGRectMake(0, 0, KB_SCREEN_WIDTH, 357)];
|
||||
self.tableView.tableHeaderView = self.header;
|
||||
}
|
||||
|
||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
// MySkinVC *vc = [[MySkinVC alloc] init];
|
||||
KBSkinDetailVC *vc = [[KBSkinDetailVC alloc] init];
|
||||
|
||||
// [self.navigationController pushViewController:vc animated:true];
|
||||
- (void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:animated];
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
- (void)viewWillDisappear:(BOOL)animated{
|
||||
[super viewWillDisappear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:animated];
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
#pragma mark - UITableView
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return self.data.count; }
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.data[section].count; }
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return CGFLOAT_MIN; }
|
||||
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
|
||||
UIView *v = [UIView new]; v.backgroundColor = [UIColor clearColor]; return v;
|
||||
}
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 20; }
|
||||
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { UIView *v = [UIView new]; v.backgroundColor = UIColor.clearColor; return v; }
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 64; }
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
KBMyListCell *cell = [tableView dequeueReusableCellWithIdentifier:[KBMyListCell reuseId]];
|
||||
if (!cell) { cell = [[KBMyListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[KBMyListCell reuseId]]; }
|
||||
|
||||
NSDictionary *info = self.data[indexPath.section][indexPath.row];
|
||||
cell.itemInfoDic = info;
|
||||
|
||||
|
||||
// 卡片圆角(每个 section 四周 8 的圆角)
|
||||
NSInteger rows = [tableView numberOfRowsInSection:indexPath.section];
|
||||
BOOL isFirst = indexPath.row == 0;
|
||||
BOOL isLast = indexPath.row == rows - 1;
|
||||
[cell applyCornersWithFirst:isFirst last:isLast];
|
||||
|
||||
// 分割线:仅上面一组显示中间线;下面一组完全不显示
|
||||
BOOL showLine = (indexPath.section == 0) && !isLast;
|
||||
[cell setLineHidden:!showLine];
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Lazy
|
||||
- (BaseTableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[BaseTableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
|
||||
_tableView.backgroundColor = [UIColor colorWithHex:0xF5F7FB];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone; // 关闭系统分割线
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -90,7 +90,7 @@ static const CGFloat JXheightForHeaderInSection = 50;
|
||||
backgroundView.indicatorHeight = 30;
|
||||
backgroundView.indicatorCornerRadius = JXCategoryViewAutomaticDimension;
|
||||
backgroundView.indicatorColor = [UIColor whiteColor]; // keep selected fill white
|
||||
backgroundView.layer.borderColor = [UIColor colorWithHex:0x02BEAC].CGColor;
|
||||
backgroundView.layer.borderColor = [UIColor colorWithHex:KBColor].CGColor;
|
||||
backgroundView.layer.borderWidth = 1;
|
||||
backgroundView.indicatorWidthIncrement = 0; // 指示器宽度不额外加宽
|
||||
// 点击切换时不需要左右滚动动画,直接跳转到目标位置
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
|
||||
#define COLOR_WITH_RGB(R,G,B,A) [UIColor colorWithRed:R green:G blue:B alpha:A]
|
||||
|
||||
#define KBColor 0x02BEAC
|
||||
|
||||
// 当前 KeyWindow(iOS 13 场景化兼容)
|
||||
static inline UIWindow *KB_KeyWindow(void) {
|
||||
|
||||