Dynamically resize iBooks HTML widget

640 Views Asked by At

I want to create a dynamic widget for iBooks 2, but I can not dynamically resize the widget to match portrait or landscape mode. I found Apples documentation for resizing dashboard widgets but this doesn't seem to work within iBooks. As an alternative it would help, if I can lock the orientation for the widget. Is there a solution to this problem?

1

There are 1 best solutions below

0
On

There is a widget object that is instantiated in dashboard and iBook contexts. It is not clear, however, if it contains any information about orientation.

It may be possible to add a listener for widget.didEnterWidgetMode, as demonstrated in this widget events demo project on github, and then read your window dimensions. This should tell you whether you are in portrait or landscape.