mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Resolving comments
This commit is contained in:
@ -660,9 +660,6 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
|
||||
} else {
|
||||
// TODO: Implement _createNativeView for iOS
|
||||
this.createNativeView();
|
||||
if (!currentNativeView) {
|
||||
console.log(`${this.typeName} doesnt have 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();
|
||||
}
|
||||
[maxDateProperty.setNative](value: Date) {
|
||||
[maxDateProperty.setNative](value: Date | number) {
|
||||
const newValue = value instanceof Date ? value.getTime() : value;
|
||||
this.nativeView.setMaxDate(newValue);
|
||||
}
|
||||
|
||||
[minDateProperty.getDefault](): Date {
|
||||
[minDateProperty.getDefault](): number {
|
||||
return this.nativeView.getMinDate();
|
||||
}
|
||||
[minDateProperty.setNative](value: Date) {
|
||||
[minDateProperty.setNative](value: Date | number) {
|
||||
const newValue = value instanceof Date ? value.getTime() : value;
|
||||
this.nativeView.setMinDate(newValue);
|
||||
}
|
||||
|
@ -159,23 +159,6 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
|
||||
(<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() {
|
||||
ad.dismissSoftInput(this.nativeView);
|
||||
}
|
||||
|
@ -5,29 +5,26 @@
|
||||
export * from "./html-view-common";
|
||||
|
||||
export class HtmlView extends HtmlViewBase {
|
||||
private _ios: UITextView;
|
||||
nativeView: UITextView;
|
||||
|
||||
constructor() {
|
||||
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._ios.editable = false;
|
||||
this._ios.selectable = true;
|
||||
this._ios.userInteractionEnabled = true;
|
||||
this._ios.dataDetectorTypes = UIDataDetectorTypes.All;
|
||||
this.nativeView = nativeView;
|
||||
}
|
||||
|
||||
get ios(): UITextView {
|
||||
return this._ios;
|
||||
return this.nativeView;
|
||||
}
|
||||
|
||||
// get nativeView(): UITextView {
|
||||
// return this._ios;
|
||||
// }
|
||||
|
||||
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
|
||||
var nativeView = this._ios;
|
||||
const nativeView = this.nativeView;
|
||||
if (nativeView) {
|
||||
const width = layout.getMeasureSpecSize(widthMeasureSpec);
|
||||
const widthMode = layout.getMeasureSpecMode(widthMeasureSpec);
|
||||
@ -54,6 +51,6 @@ export class HtmlView extends HtmlViewBase {
|
||||
[htmlProperty.setNative](value: string) {
|
||||
const htmlString = NSString.stringWithString(value + "");
|
||||
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);
|
||||
hourProperty.nativeValueChange(timePicker, validTime.hour);
|
||||
minuteProperty.nativeValueChange(timePicker, validTime.minute);
|
||||
timeProperty.nativeValueChange(timePicker, new Date(0, 0, 0, validTime.hour, validTime.minute));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user