Skip to content

Commit

Permalink
fix(ios) : image display
Browse files Browse the repository at this point in the history
  • Loading branch information
triniwiz committed Oct 23, 2018
1 parent c127815 commit 4470784
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/image-zoom.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
zoomScaleProperty
} from './image-zoom.common';
import * as fs from 'tns-core-modules/file-system';

import { layout } from 'tns-core-modules/ui/core/view';
export class ImageZoom extends ImageZoomBase {
_image: any;
private delegate: any;
Expand Down Expand Up @@ -38,6 +38,15 @@ export class ImageZoom extends ImageZoomBase {
this._image.frame = this.nativeView.bounds;
}

public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number) {
const nativeView = this.nativeView;
if (nativeView) {
const width = layout.getMeasureSpecSize(widthMeasureSpec);
const height = layout.getMeasureSpecSize(heightMeasureSpec);
this.setMeasuredDimension(width, height);
}
}

public initNativeView() {
this.delegate = UIScrollViewDelegateImpl.initWithOwner(
new WeakRef<ImageZoom>(this)
Expand Down

0 comments on commit 4470784

Please sign in to comment.