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);
|
||||
|
||||
@@ -217,6 +217,12 @@ export class ListView extends ListViewBase {
|
||||
this._delegate = UITableViewDelegateImpl.initWithOwner(new WeakRef(this));
|
||||
this._heights = new Array<number>();
|
||||
this._map = new Map<ListViewCell, View>();
|
||||
this._setNativeClipToBounds();
|
||||
}
|
||||
|
||||
_setNativeClipToBounds() {
|
||||
// Always set clipsToBounds for list-view
|
||||
this._ios.clipsToBounds = true;
|
||||
}
|
||||
|
||||
public onLoaded() {
|
||||
|
||||
@@ -36,6 +36,12 @@ export class ScrollView extends ScrollViewBase {
|
||||
constructor() {
|
||||
super();
|
||||
this.nativeView = UIScrollView.new();
|
||||
this._setNativeClipToBounds();
|
||||
}
|
||||
|
||||
_setNativeClipToBounds() {
|
||||
// Always set clipsToBounds for scroll-view
|
||||
this.nativeView.clipsToBounds = true;
|
||||
}
|
||||
|
||||
protected attachNative() {
|
||||
|
||||
Reference in New Issue
Block a user