I wish to put a wait until the iPad screen is done rotating and want to have both rotate and wait in the same function. If I don't add few seconds of wait, then the app doesn't behave as expected. Below is the function:
LandScapeRight = function()
{
return UIATarget.localTarget().setDeviceOrientation(UIA_DEVICE_ORIENTATION_LANDSCAPERIGHT);
}
Please suggest.
You want to use the delay()
method on UIATarget
. The docs for the class are here
The quick and dirty way to do the delay you want is like so:
LandScapeRight = function()
{
var target = UIATarget.localTarget();
target.setDeviceOrientation(UIA_DEVICE_ORIENTATION_LANDSCAPERIGHT);
target.delay(1); // Delay is in seconds, can be a fraction
}