mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor(core-modules): implement createNativeView and initNativeView for all components
refactor(core-modules): implement createNativeView and initNativeView for all components
This commit is contained in:
committed by
Martin Yankov
parent
71107533bb
commit
46705ee332
@@ -10,14 +10,15 @@ export class Image extends ImageBase {
|
||||
private _imageSourceAffectsLayout: boolean = true;
|
||||
private _templateImageWasCreated: boolean;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
//TODO: Think of unified way of setting all the default values.
|
||||
public createNativeView() {
|
||||
const imageView = UIImageView.new();
|
||||
imageView.contentMode = UIViewContentMode.ScaleAspectFit;
|
||||
imageView.userInteractionEnabled = true;
|
||||
this.nativeViewProtected = imageView;
|
||||
return imageView;
|
||||
}
|
||||
|
||||
public initNativeView(): void {
|
||||
super.initNativeView();
|
||||
this._setNativeClipToBounds();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user