diff --git a/Source/SLKTextInputbar.h b/Source/SLKTextInputbar.h index da17837f..09f92d9a 100644 --- a/Source/SLKTextInputbar.h +++ b/Source/SLKTextInputbar.h @@ -26,7 +26,7 @@ typedef NS_ENUM(NSUInteger, SLKCounterPosition) { NS_ASSUME_NONNULL_BEGIN /** @name A custom tool bar encapsulating messaging controls. */ -@interface SLKTextInputbar : UIToolbar +@interface SLKTextInputbar : UIView /** The centered text input view. The maximum number of lines is configured by default, to best fit each devices dimensions. diff --git a/Source/SLKTextInputbar.m b/Source/SLKTextInputbar.m index 9d64e04c..5c2b115a 100644 --- a/Source/SLKTextInputbar.m +++ b/Source/SLKTextInputbar.m @@ -42,6 +42,9 @@ @interface SLKTextInputbar () @property (nonatomic, strong) NSLayoutConstraint *rightButtonTopMarginC; @property (nonatomic, strong) NSLayoutConstraint *rightButtonBottomMarginC; @property (nonatomic, strong) NSLayoutConstraint *editorContentViewHC; + +@property (strong, nonatomic) UIView *hairlineView; + @property (nonatomic, strong) NSArray *charCountLabelVCs; @property (nonatomic, strong) UILabel *charCountLabel; @@ -95,6 +98,7 @@ - (void)slk_commonInit self.autoHideRightButton = YES; self.editorContentViewHeight = 38.0; self.contentInset = UIEdgeInsetsMake(5.0, 8.0, 5.0, 8.0); + self.backgroundColor = [UIColor colorWithRed:247.0/255.0 green:247.0/255.0 blue:247.0/255.0 alpha:1.0]; //UIToolbar native bar tint color [self addSubview:self.editorContentView]; [self addSubview:self.leftButton]; @@ -103,6 +107,7 @@ - (void)slk_commonInit [self addSubview:self.textView]; [self addSubview:self.charCountLabel]; [self addSubview:self.contentView]; + [self addSubview:self.hairlineView]; [self slk_setupViewConstraints]; [self slk_updateConstraintConstants]; @@ -165,6 +170,17 @@ - (SLKTextView *)textView } return _textView; } + + - (UIView *) hairlineView + { + if (!_hairlineView) { + _hairlineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 0.5)]; + _hairlineView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleBottomMargin; + _hairlineView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3]; + } + + return _hairlineView; + } - (UIView *)contentView { @@ -435,7 +451,9 @@ - (NSUInteger)slk_defaultNumberOfLines - (void)setBackgroundColor:(UIColor *)color { - self.barTintColor = color; +// self.barTintColor = color; + + [super setBackgroundColor:color]; self.editorContentView.backgroundColor = color; } diff --git a/Source/SLKTextViewController.m b/Source/SLKTextViewController.m index aa85d721..c38c89dc 100644 --- a/Source/SLKTextViewController.m +++ b/Source/SLKTextViewController.m @@ -2280,7 +2280,7 @@ - (void)slk_setupViewConstraints NSDictionary *views = @{@"scrollView": self.scrollViewProxy, @"autoCompletionView": self.autoCompletionView, @"typingIndicatorView": self.typingIndicatorProxyView, - @"textInputbar": self.textInputbar + @"textInputbar": self.textInputbar, }; [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[scrollView(0@750)][typingIndicatorView(0)]-0@999-[textInputbar(0)]|" options:0 metrics:nil views:views]];