| 559 | } else { |
| 560 | //use CSS & attribute width & height if option is not provided |
| 561 | const handler = () => { |
| 562 | if (this.viewController) { |
| 563 | const w = <number>(this.width || this.style.width); |
| 564 | const h = <number>(this.height || this.style.height); |
| 565 | |
| 566 | //TODO: only numeric value is supported, percentage value is not supported like Android |
| 567 | if (w > 0 && h > 0) { |
| 568 | this.viewController.preferredContentSize = CGSizeMake(w, h); |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | this.off(View.loadedEvent, handler); |
| 573 | }; |
| 574 | |
| 575 | this.on(View.loadedEvent, handler); |
| 576 | } |