Always set clipToBounds for images, list-view and scroll-view

This commit is contained in:
vakrilov
2017-03-17 15:22:30 +02:00
parent cc96fd0cfe
commit f29f7cb607
4 changed files with 36 additions and 19 deletions

View File

@@ -16,8 +16,8 @@ export class Image extends ImageBase {
//TODO: Think of unified way of setting all the default values.
this._ios = UIImageView.new();
this._ios.contentMode = UIViewContentMode.ScaleAspectFit;
this._ios.clipsToBounds = true;
this._ios.userInteractionEnabled = true;
this._setNativeClipToBounds();
}
get ios(): UIImageView {
@@ -45,6 +45,11 @@ export class Image extends ImageBase {
}
}
_setNativeClipToBounds() {
// Always set clipsToBounds for images
this._ios.clipsToBounds = true;
}
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
// We don't call super because we measure native view with specific size.
let width = layout.getMeasureSpecSize(widthMeasureSpec);