热点连接流程修改
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
|
||||
@interface IQTextView ()
|
||||
|
||||
@property(nonatomic, strong) UILabel *placeholderLabel;
|
||||
@property(nullable, nonatomic, strong) UILabel *placeholderLabel;
|
||||
|
||||
@end
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
-(void)refreshPlaceholder
|
||||
{
|
||||
if([[self text] length])
|
||||
if([[self text] length] || [[self attributedText] length])
|
||||
{
|
||||
[_placeholderLabel setAlpha:0];
|
||||
}
|
||||
@@ -87,6 +87,12 @@
|
||||
[self refreshPlaceholder];
|
||||
}
|
||||
|
||||
-(void)setAttributedText:(NSAttributedString *)attributedText
|
||||
{
|
||||
[super setAttributedText:attributedText];
|
||||
[self refreshPlaceholder];
|
||||
}
|
||||
|
||||
-(void)setFont:(UIFont *)font
|
||||
{
|
||||
[super setFont:font];
|
||||
@@ -119,6 +125,14 @@
|
||||
[self refreshPlaceholder];
|
||||
}
|
||||
|
||||
-(void)setAttributedPlaceholder:(NSAttributedString *)attributedPlaceholder
|
||||
{
|
||||
_attributedPlaceholder = attributedPlaceholder;
|
||||
|
||||
self.placeholderLabel.attributedText = attributedPlaceholder;
|
||||
[self refreshPlaceholder];
|
||||
}
|
||||
|
||||
-(void)setPlaceholderTextColor:(UIColor*)placeholderTextColor
|
||||
{
|
||||
_placeholderTextColor = placeholderTextColor;
|
||||
@@ -151,7 +165,16 @@
|
||||
_placeholderLabel.font = self.font;
|
||||
_placeholderLabel.textAlignment = self.textAlignment;
|
||||
_placeholderLabel.backgroundColor = [UIColor clearColor];
|
||||
_placeholderLabel.textColor = [UIColor colorWithWhite:0.7 alpha:1.0];
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_placeholderLabel.textColor = [UIColor systemGrayColor];
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
|
||||
_placeholderLabel.textColor = [UIColor lightTextColor];
|
||||
#endif
|
||||
}
|
||||
_placeholderLabel.alpha = 0;
|
||||
[self addSubview:_placeholderLabel];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user