fix(ios): add caretColor property support

This commit is contained in:
ruifanyuan
2023-11-06 09:47:30 +00:00
committed by hippy-actions[bot]
parent 00f54e85ba
commit 46b4e776e6
3 changed files with 24 additions and 0 deletions
@@ -48,6 +48,14 @@
}
}
- (UIColor*)caretColor{
return self.tintColor;
}
- (void)setCaretColor:(UIColor*)color{
self.tintColor = color;
}
- (void)setReturnKeyType:(UIReturnKeyType) returnKeyType{
[super setReturnKeyType:returnKeyType];
if([self isFirstResponder]){
@@ -55,6 +55,21 @@
return [super resignFirstResponder];
}
- (void)setKeyboardType:(UIKeyboardType)keyboardType {
[super setKeyboardType:keyboardType];
if([self isFirstResponder]){
[self reloadInputViews];
}
}
- (UIColor*)caretColor{
return self.tintColor;
}
- (void)setCaretColor:(UIColor*)color{
self.tintColor = color;
}
@end
@interface NativeRenderTextView () <NativeRenderUITextViewResponseDelegate>
@@ -170,6 +170,7 @@ HIPPY_REMAP_VIEW_PROPERTY(selectionColor, tintColor, UIColor)
HIPPY_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL)
HIPPY_EXPORT_VIEW_PROPERTY(selection, NativeRenderTextSelection)
HIPPY_EXPORT_VIEW_PROPERTY(text, NSString)
HIPPY_REMAP_VIEW_PROPERTY(caretColor, textView.caretColor, UIColor)
HIPPY_CUSTOM_SHADOW_PROPERTY(fontSize, NSNumber, NativeRenderObjectTextView) {
view.font = [HippyFont updateFont:view.font withSize:json];