mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Resolving comments
This commit is contained in:
@ -660,9 +660,6 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
|
|||||||
} else {
|
} else {
|
||||||
// TODO: Implement _createNativeView for iOS
|
// TODO: Implement _createNativeView for iOS
|
||||||
this.createNativeView();
|
this.createNativeView();
|
||||||
if (!currentNativeView) {
|
|
||||||
console.log(`${this.typeName} doesnt have NativeView !!!!! =================`);
|
|
||||||
}
|
|
||||||
// this.nativeView = this._iosView = (<any>this)._nativeView;
|
// this.nativeView = this._iosView = (<any>this)._nativeView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,18 +119,18 @@ export class DatePicker extends DatePickerBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[maxDateProperty.getDefault](): Date {
|
[maxDateProperty.getDefault](): number {
|
||||||
return this.nativeView.getMaxDate();
|
return this.nativeView.getMaxDate();
|
||||||
}
|
}
|
||||||
[maxDateProperty.setNative](value: Date) {
|
[maxDateProperty.setNative](value: Date | number) {
|
||||||
const newValue = value instanceof Date ? value.getTime() : value;
|
const newValue = value instanceof Date ? value.getTime() : value;
|
||||||
this.nativeView.setMaxDate(newValue);
|
this.nativeView.setMaxDate(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
[minDateProperty.getDefault](): Date {
|
[minDateProperty.getDefault](): number {
|
||||||
return this.nativeView.getMinDate();
|
return this.nativeView.getMinDate();
|
||||||
}
|
}
|
||||||
[minDateProperty.setNative](value: Date) {
|
[minDateProperty.setNative](value: Date | number) {
|
||||||
const newValue = value instanceof Date ? value.getTime() : value;
|
const newValue = value instanceof Date ? value.getTime() : value;
|
||||||
this.nativeView.setMinDate(newValue);
|
this.nativeView.setMinDate(newValue);
|
||||||
}
|
}
|
||||||
|
@ -159,23 +159,6 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
|
|||||||
(<any>this.nativeView).listener.owner = null;
|
(<any>this.nativeView).listener.owner = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public _resetNativeView(force?: boolean) {
|
|
||||||
// if (this._android) {
|
|
||||||
// this._android.setOnFocusChangeListener(null);
|
|
||||||
// this._android.setOnEditorActionListener(null);
|
|
||||||
|
|
||||||
// if (this._editTextListeners) {
|
|
||||||
// this._android.removeTextChangedListener(this._editTextListeners);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// super.resetNativeView();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public _disposeNativeView(force?: boolean) {
|
|
||||||
// this._android = undefined;
|
|
||||||
// super.disposeNativeView();
|
|
||||||
// }
|
|
||||||
|
|
||||||
public dismissSoftInput() {
|
public dismissSoftInput() {
|
||||||
ad.dismissSoftInput(this.nativeView);
|
ad.dismissSoftInput(this.nativeView);
|
||||||
}
|
}
|
||||||
|
@ -5,29 +5,26 @@
|
|||||||
export * from "./html-view-common";
|
export * from "./html-view-common";
|
||||||
|
|
||||||
export class HtmlView extends HtmlViewBase {
|
export class HtmlView extends HtmlViewBase {
|
||||||
private _ios: UITextView;
|
nativeView: UITextView;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.nativeView = this._ios = UITextView.new();
|
const nativeView = UITextView.new()
|
||||||
|
nativeView.scrollEnabled = false;
|
||||||
|
nativeView.editable = false;
|
||||||
|
nativeView.selectable = true;
|
||||||
|
nativeView.userInteractionEnabled = true;
|
||||||
|
nativeView.dataDetectorTypes = UIDataDetectorTypes.All;
|
||||||
|
|
||||||
this._ios.scrollEnabled = false;
|
this.nativeView = nativeView;
|
||||||
this._ios.editable = false;
|
|
||||||
this._ios.selectable = true;
|
|
||||||
this._ios.userInteractionEnabled = true;
|
|
||||||
this._ios.dataDetectorTypes = UIDataDetectorTypes.All;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get ios(): UITextView {
|
get ios(): UITextView {
|
||||||
return this._ios;
|
return this.nativeView;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get nativeView(): UITextView {
|
|
||||||
// return this._ios;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
|
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
|
||||||
var nativeView = this._ios;
|
const nativeView = this.nativeView;
|
||||||
if (nativeView) {
|
if (nativeView) {
|
||||||
const width = layout.getMeasureSpecSize(widthMeasureSpec);
|
const width = layout.getMeasureSpecSize(widthMeasureSpec);
|
||||||
const widthMode = layout.getMeasureSpecMode(widthMeasureSpec);
|
const widthMode = layout.getMeasureSpecMode(widthMeasureSpec);
|
||||||
@ -54,6 +51,6 @@ export class HtmlView extends HtmlViewBase {
|
|||||||
[htmlProperty.setNative](value: string) {
|
[htmlProperty.setNative](value: string) {
|
||||||
const htmlString = NSString.stringWithString(value + "");
|
const htmlString = NSString.stringWithString(value + "");
|
||||||
const nsData = htmlString.dataUsingEncoding(NSUnicodeStringEncoding);
|
const nsData = htmlString.dataUsingEncoding(NSUnicodeStringEncoding);
|
||||||
this._ios.attributedText = NSAttributedString.alloc().initWithDataOptionsDocumentAttributesError(nsData, <any>{ [NSDocumentTypeDocumentAttribute]: NSHTMLTextDocumentType }, null);
|
this.nativeView.attributedText = NSAttributedString.alloc().initWithDataOptionsDocumentAttributesError(nsData, <any>{ [NSDocumentTypeDocumentAttribute]: NSHTMLTextDocumentType }, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,6 @@ function initializeTimeChangedListener(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const validTime = getValidTime(timePicker, hour, minute);
|
const validTime = getValidTime(timePicker, hour, minute);
|
||||||
hourProperty.nativeValueChange(timePicker, validTime.hour);
|
|
||||||
minuteProperty.nativeValueChange(timePicker, validTime.minute);
|
|
||||||
timeProperty.nativeValueChange(timePicker, new Date(0, 0, 0, validTime.hour, validTime.minute));
|
timeProperty.nativeValueChange(timePicker, new Date(0, 0, 0, validTime.hour, validTime.minute));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user