NimbleKit - fast iOS app development

Orientation Support

Please post here if you think only NimbleKit developers can solve your problem

Orientation Support

Postby ChimpWorks » Fri Oct 07, 2011 6:14 pm

From the manual...

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>
Image
User avatar
ChimpWorks
 
Posts: 41
Joined: Tue Aug 09, 2011 2:03 am

Re: Orientation Support

Postby cactuscraig » Fri Oct 07, 2011 8:09 pm

do you use TabController? With that, if I recall, all pages must support rotation.
User avatar
cactuscraig
 
Posts: 846
Joined: Thu Feb 03, 2011 5:15 pm
Location: Scottsdale, AZ

Re: Orientation Support

Postby ChimpWorks » Sat Oct 08, 2011 12:33 am

No, no tab control just as you see it above.
Image
User avatar
ChimpWorks
 
Posts: 41
Joined: Tue Aug 09, 2011 2:03 am

Re: Orientation Support

Postby cactuscraig » Sat Oct 08, 2011 2:03 am

thought you might be using it on main.html... and that this was another page within...
User avatar
cactuscraig
 
Posts: 846
Joined: Thu Feb 03, 2011 5:15 pm
Location: Scottsdale, AZ

Re: Orientation Support

Postby ChimpWorks » Sun Oct 09, 2011 2:52 pm

Can you get this feature to work?
Image
User avatar
ChimpWorks
 
Posts: 41
Joined: Tue Aug 09, 2011 2:03 am

Re: Orientation Support

Postby cactuscraig » Mon Oct 10, 2011 1:14 am

Have not tried to NOT get it to work...

Sorry.
User avatar
cactuscraig
 
Posts: 846
Joined: Thu Feb 03, 2011 5:15 pm
Location: Scottsdale, AZ

Re: Orientation Support

Postby ChimpWorks » Mon Oct 10, 2011 9:48 pm

When you have a spare moment, I'd be grateful if you could try the attached project and let me know if Page 2 rotates. If it does then the function NKIsPageSupportsAutoOrientation is not working as expected, in which case I'll report this as a bug.
Thanks
Attachments
Orientation.zip
(1.08 MiB) Downloaded 84 times
Image
User avatar
ChimpWorks
 
Posts: 41
Joined: Tue Aug 09, 2011 2:03 am

Re: Orientation Support

Postby cactuscraig » Tue Oct 11, 2011 12:02 am

i guess it IS rotating - the bars stay on top and bottom instead of left and right...
take a look at this one:
viewtopic.php?f=5&t=3253
User avatar
cactuscraig
 
Posts: 846
Joined: Thu Feb 03, 2011 5:15 pm
Location: Scottsdale, AZ

Re: Orientation Support

Postby ChimpWorks » Tue Oct 11, 2011 6:26 pm

I've reported this as a bug, so lets see if any light is shed on this from the NK team.
Image
User avatar
ChimpWorks
 
Posts: 41
Joined: Tue Aug 09, 2011 2:03 am

Re: Orientation Support

Postby sunny » Tue Jan 24, 2012 1:04 am

this is fixed in 1.9.9
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Next

Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest