1
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "UIColor+Extension.h"
|
||||
#import "KBPersonInfoVC.h"
|
||||
#import "KBMyKeyBoardVC.h"
|
||||
|
||||
@interface KBMyHeaderView ()
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@@ -193,7 +194,10 @@
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
- (void)onKeyboardTap { if (self.onKeyboardTapped) { self.onKeyboardTapped(); } }
|
||||
- (void)onKeyboardTap {
|
||||
KBMyKeyBoardVC *vc = [[KBMyKeyBoardVC alloc] init];
|
||||
[KB_CURRENT_NAV pushViewController:vc animated:true];
|
||||
}
|
||||
- (void)onAvatarTap {
|
||||
KBPersonInfoVC *vc = [[KBPersonInfoVC alloc] init];
|
||||
[KB_CURRENT_NAV pushViewController:vc animated:true];
|
||||
|
||||
@@ -2,12 +2,6 @@
|
||||
// KBMyKeyboardCell.m
|
||||
// keyBoard
|
||||
//
|
||||
// 截图页标签样式 cell,实现:
|
||||
// - 左侧 Emoji,中间标题;
|
||||
// - 右上角小圆点(减号),用于删除编辑态展示;
|
||||
// - 白底圆角,阴影/描边轻微以贴近设计;
|
||||
// - 暴露 +sizeForEmoji:title: 以便外部根据文本动态决定 item 宽度。
|
||||
//
|
||||
|
||||
#import "KBMyKeyboardCell.h"
|
||||
|
||||
@@ -18,6 +12,7 @@
|
||||
@property (nonatomic, strong) UILabel *titleLabel; // 标题
|
||||
@property (nonatomic, strong) UIView *minusBadge; // 右上角减号圆点
|
||||
@property (nonatomic, strong) UILabel *minusLabel; // 减号
|
||||
@property (nonatomic, strong) UIControl *minusTapArea; // 放大点击区域(透明)
|
||||
@end
|
||||
|
||||
@implementation KBMyKeyboardCell
|
||||
@@ -65,7 +60,15 @@
|
||||
make.center.equalTo(self.minusBadge);
|
||||
}];
|
||||
|
||||
// 点击右上角减号
|
||||
// 点击右上角减号:在其上方覆盖一层更大的透明点击区域,提升可点性
|
||||
[self.contentView addSubview:self.minusTapArea];
|
||||
[self.minusTapArea mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.contentView).offset(0);
|
||||
make.right.equalTo(self.contentView).offset(0);
|
||||
make.width.height.mas_equalTo(32); // 扩大到 32x32,更易点中
|
||||
}];
|
||||
// 将可点事件绑定到透明区域;保留 minusBadge 的手势作为兜底
|
||||
[self.minusTapArea addTarget:self action:@selector(didTapMinus) forControlEvents:UIControlEventTouchUpInside];
|
||||
self.minusBadge.userInteractionEnabled = YES;
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapMinus)];
|
||||
[self.minusBadge addGestureRecognizer:tap];
|
||||
@@ -152,6 +155,16 @@
|
||||
return _minusLabel;
|
||||
}
|
||||
|
||||
- (UIControl *)minusTapArea {
|
||||
if (!_minusTapArea) {
|
||||
_minusTapArea = [[UIControl alloc] init];
|
||||
_minusTapArea.backgroundColor = [UIColor clearColor];
|
||||
// 提高命中率:即使轻微偏离也能点中
|
||||
_minusTapArea.accessibilityLabel = @"删除";
|
||||
}
|
||||
return _minusTapArea;
|
||||
}
|
||||
|
||||
- (UIView *)coverView{
|
||||
if (!_coverView) {
|
||||
_coverView = [[UIView alloc] init];
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#import "KBSkinDetailVC.h"
|
||||
#import "KBMyHeaderView.h" // 顶部视图独立封装
|
||||
#import "KBMyListCell.h"
|
||||
#import "KBMyKeyBoardVC.h"
|
||||
|
||||
@interface MyVC () <UITableViewDelegate, UITableViewDataSource>
|
||||
@property (nonatomic, strong) BaseTableView *tableView; // 列表
|
||||
@@ -93,8 +92,7 @@
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
KBMyKeyBoardVC *vc = [[KBMyKeyBoardVC alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:true];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Lazy
|
||||
|
||||
Reference in New Issue
Block a user