NKIsPageSupportsAutoOrientation()
This function must be implemented and return “no” if you don’t want to some specific page to have orientations supported. By default auto orientation is supported and possible orientations are read from your application plist file (in xcode4 those can be set in editor graphically)
Example:
function NKIsPageSupportsAutoOrientation() {
return "no";
}
I have auto orientation working but when I try and prevent it on a particular page using the above function it doesn't work?
This is the pages code...
- Code: Select all
<html>
<head>
<meta name = "viewport" content = "initial-scale = 1.0, user-scalable = yes" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="style.css" media="screen" rel="stylesheet" type="text/css">
<script type="text/javascript" src="NKit.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function NKIsPageSupportsAutoOrientation()
{
return "no";
}
var navController = new NKNavigationController();
navController.setTintColor(0, 194, 248);
var page = NKGetParameter('page');
var device = NKGetDeviceType();
var isRetina = (window.devicePixelRatio && window.devicePixelRatio == 2);
var isiPad = (device.match(/iPad/i) != null);
var suffix = ".png";
var fullWidth = 300;
var halfWidth = 150;
if(isRetina)
{
suffix = "@2x.png";
}
if(isiPad)
{
suffix = "@2x.png";
fullWidth = 600;
halfWidth = 300;
}
// Load page content via jQuery
$(document).ready(function(){
$('#content').load('html/'+page);
});
</script>
</head>
<body>
<div id="content">
<div style="display:table;margin:auto;height:100%;">
<p style="display: table-cell; vertical-align: middle;">loading...</p>
</div>
</div>
</body>
</html>

