mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Always set clipToBounds for images, list-view and scroll-view
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user