1
This commit is contained in:
@@ -11,13 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
/// 粘贴提示输入框区域(左侧图标+占位文案,圆角白底)
|
/// 粘贴提示输入框区域(左侧图标+占位文案,圆角白底)
|
||||||
@interface KBFunctionPasteView : UIView
|
@interface KBFunctionPasteView : UIView
|
||||||
|
@property (nonatomic, strong) UIButton *pasBtn;
|
||||||
/// 左侧图标
|
|
||||||
@property (nonatomic, strong, readonly) UIImageView *iconView;
|
|
||||||
|
|
||||||
/// 提示文案,例如:点击粘贴TA的话
|
|
||||||
@property (nonatomic, strong, readonly) UILabel *placeholderLabel;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -10,9 +10,8 @@
|
|||||||
#import "KBFont.h"
|
#import "KBFont.h"
|
||||||
|
|
||||||
@interface KBFunctionPasteView ()
|
@interface KBFunctionPasteView ()
|
||||||
@property (nonatomic, strong) UIImageView *iconViewInternal;
|
//@property (nonatomic, strong) UIImageView *iconViewInternal;
|
||||||
@property (nonatomic, strong) UILabel *placeholderLabelInternal;
|
//@property (nonatomic, strong) UILabel *placeholderLabelInternal;
|
||||||
@property (nonatomic, strong) UIButton *pasBtn;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -48,25 +47,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Lazy
|
#pragma mark - Lazy
|
||||||
|
//
|
||||||
- (UIImageView *)iconViewInternal {
|
//- (UIImageView *)iconViewInternal {
|
||||||
if (!_iconViewInternal) {
|
// if (!_iconViewInternal) {
|
||||||
_iconViewInternal = [[UIImageView alloc] init];
|
// _iconViewInternal = [[UIImageView alloc] init];
|
||||||
_iconViewInternal.image = [UIImage imageNamed:@"kb_zt_icon"];
|
// _iconViewInternal.image = [UIImage imageNamed:@"kb_zt_icon"];
|
||||||
}
|
// }
|
||||||
return _iconViewInternal;
|
// return _iconViewInternal;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
- (UILabel *)placeholderLabelInternal {
|
//- (UILabel *)placeholderLabelInternal {
|
||||||
if (!_placeholderLabelInternal) {
|
// if (!_placeholderLabelInternal) {
|
||||||
_placeholderLabelInternal = [[UILabel alloc] init];
|
// _placeholderLabelInternal = [[UILabel alloc] init];
|
||||||
// 文案改为更贴近设计稿
|
// // 文案改为更贴近设计稿
|
||||||
_placeholderLabelInternal.text = KBLocalized(@"Paste Ta's Words");
|
// _placeholderLabelInternal.text = KBLocalized(@"Paste Ta's Words");
|
||||||
_placeholderLabelInternal.textColor = [UIColor colorWithRed:0.20 green:0.64 blue:0.54 alpha:1.0];
|
// _placeholderLabelInternal.textColor = [UIColor colorWithRed:0.20 green:0.64 blue:0.54 alpha:1.0];
|
||||||
_placeholderLabelInternal.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
// _placeholderLabelInternal.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||||
}
|
// }
|
||||||
return _placeholderLabelInternal;
|
// return _placeholderLabelInternal;
|
||||||
}
|
//}
|
||||||
|
|
||||||
- (UIButton *)pasBtn{
|
- (UIButton *)pasBtn{
|
||||||
if (!_pasBtn) {
|
if (!_pasBtn) {
|
||||||
@@ -82,7 +81,7 @@
|
|||||||
|
|
||||||
#pragma mark - Expose
|
#pragma mark - Expose
|
||||||
|
|
||||||
- (UIImageView *)iconView { return self.iconViewInternal; }
|
//- (UIImageView *)iconView { return self.iconViewInternal; }
|
||||||
- (UILabel *)placeholderLabel { return self.placeholderLabelInternal; }
|
//- (UILabel *)placeholderLabel { return self.placeholderLabelInternal; }
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -473,9 +473,18 @@ typedef NS_ENUM(NSInteger, KBGuideItemType) {
|
|||||||
// 避免点到输入栏触发收起
|
// 避免点到输入栏触发收起
|
||||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
|
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
|
||||||
if (gestureRecognizer == self.bgTap) {
|
if (gestureRecognizer == self.bgTap) {
|
||||||
|
// 1) 点在输入栏区域:不当作“背景点击”
|
||||||
if ([touch.view isDescendantOfView:self.inputBar]) {
|
if ([touch.view isDescendantOfView:self.inputBar]) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
// 2) 点在任意 cell(包括 KBGuideTopCell)内部:不当作“背景点击”,避免复制时收起键盘
|
||||||
|
UIView *v = touch.view;
|
||||||
|
while (v && ![v isKindOfClass:UITableViewCell.class]) {
|
||||||
|
v = v.superview;
|
||||||
|
}
|
||||||
|
if (v) { // 找到了 cell
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user