[ios] Fixed UITextView keyboard coloring.

This commit is contained in:
Ilya Grechuhin 2016-08-04 16:39:29 +03:00
parent fb72277fb1
commit 52574e0f2a
6 changed files with 14 additions and 2 deletions

View file

@ -1,4 +1,4 @@
#import "UIColor+MapsMeColor.h"
#import "RichTextVC.h"
#import "UIFont+MapsMeFonts.h"
@ -39,6 +39,7 @@
_textView.textContainerInset = UIEdgeInsetsMake(10, 5, 10, 5);
_textView.font = [UIFont regular16];
_textView.dataDetectorTypes = UIDataDetectorTypeLink;
_textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault;
}
return _textView;
}

View file

@ -34,6 +34,7 @@ static NSString * const kStatisticsEvent = @"Routing Disclaimer Alert";
attributes:@{NSFontAttributeName : UIFont.regular14,
NSForegroundColorAttributeName : UIColor.blackSecondaryText}];
[alert.textView sizeToFit];
alert.textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault;
UIWindow * window = UIApplication.sharedApplication.keyWindow;
CGFloat height;
if (isIOS7)

View file

@ -1,3 +1,4 @@
#import "UIColor+MapsMeColor.h"
#import "MWMTextView.h"
#import "MWMNoteCell.h"
@ -26,6 +27,7 @@ static void * kContext = &kContext;
{
self.delegate = delegate;
self.textView.text = text;
self.textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault;
self.textView.placeholder = placeholder;
}

View file

@ -3,6 +3,7 @@
#import "MWMOpeningHoursModel.h"
#import "MWMOpeningHoursSection.h"
#import "MWMTextView.h"
#import "UIColor+MapsMeColor.h"
extern NSDictionary * const kMWMOpeningHoursEditorTableCells = @{
@(MWMOpeningHoursEditorDaysSelectorCell) : @"MWMOpeningHoursDaysSelectorTableViewCell",
@ -72,6 +73,7 @@ extern NSDictionary * const kMWMOpeningHoursEditorTableCells = @{
- (void)configAdvancedEditor
{
[self.editorView setTextContainerInset:{.top = 12, .left = 10, .bottom = 12, .right = 10}];
self.editorView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault;
NSString * path = [[NSBundle mainBundle] pathForResource:@"opening_hours_how_to_edit" ofType:@"html"];
NSString * html = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
NSURL * baseURL = [NSURL fileURLWithPath:path];

View file

@ -57,6 +57,7 @@ void performRenderingInConcurrentQueue(TMWMVoidBlock block)
{
self.delegate = delegate;
self.textView.width = width - 2 * kTextViewLeft;
self.textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault;
BOOL const isEmpty = text.length == 0;
if (isEmpty)
[self configEmptyDescription];

View file

@ -6,6 +6,7 @@
#import "Statistics.h"
#import "UIFont+MapsMeFonts.h"
#import "UIImageView+Coloring.h"
#import "UIColor+MapsMeColor.h"
#include "platform/settings.hpp"
#include "platform/measurement_utils.hpp"
@ -29,7 +30,11 @@
{
[super awakeFromNib];
if ([self.textContainer isKindOfClass:[UITextView class]])
[(UITextView *)self.textContainer setTextContainerInset:{.top = 12}];
{
UITextView * textView = (UITextView *)self.textContainer;
[textView setTextContainerInset:{.top = 12}];
textView.keyboardAppearance = [UIColor isNightMode] ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault;
}
}
- (void)configureWithType:(MWMPlacePageCellType)type info:(NSString *)info;