热点连接流程修改

This commit is contained in:
wbzhan
2019-09-21 17:29:16 +08:00
parent 9342faecbc
commit 41e5233e1f
65 changed files with 2363 additions and 651 deletions
@@ -35,6 +35,11 @@
*/
@property(nullable, nonatomic,copy) IBInspectable NSString *placeholder;
/**
Set textView's placeholder attributed text. Default is nil.
*/
@property(nullable, nonatomic,copy) IBInspectable NSAttributedString *attributedPlaceholder;
/**
To set textView's placeholder text color. Default is nil.
*/
@@ -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];
}