UA-17470720-3

Jump to content


Photo
- - - - -

Rotation issue on SCTableViewController detail page


  • Please log in to reply
5 replies to this topic

#1 gayraud

gayraud

    Jr. Member

  • STV 5.0 Pro
  • PipPip
  • 28 posts
Reputation: 0
Neutral

Posted 30 August 2015 - 11:51 PM

Hello

 

I have built an ipad with STV and I have some screens that will be display in landscape mode.

I disable rotation for all SCTableViewController  viewControllers, It's working OK on the Table display (master view), but when I enter the detail page (detail view), the screen rotate to landscape mode.

How can I disable also rotation for detail page ?

 

FYI I am using this kind of code for that.

 

#ifdef IOS_OLDER_THAN_6

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

    return (interfaceOrientation == UIInterfaceOrientationPortrait);

}

#endif

 

#ifdef IOS_NEWER_OR_EQUAL_TO_6

- (BOOL)shouldAutorotate

{

    return NO;

}

 

-(NSUInteger)supportedInterfaceOrientations

{

    return UIInterfaceOrientationMaskPortrait;

}

#endif



#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 31 August 2015 - 06:31 AM

Hi gayraud,

 

STV detail view controllers should automatically inherit the value returned in your MasterViewController's 'supportedInterfaceOrientations'. I am worried that there might be an issue with your custom #ifdefs. Would you please try replacing the above code with the following:

 

- (BOOL)shouldAutorotate
{
    return NO;
}
 
-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}

 

On a side note: STV 5.0 only supports iOS 7 and later, so there is no reason for checking for iOS 6 anyways.



#3 gayraud

gayraud

    Jr. Member

  • STV 5.0 Pro
  • PipPip
  • 28 posts
Reputation: 0
Neutral

Posted 31 August 2015 - 07:37 AM

Thanks Tarek for your prompt feedback, unfortunately there is no change without the #ifdef block

 

Please see capture #1 : TableView is showing only portrait as requested

 

iOSSimulator17.28.56.png

 

capture #2 : Detail is displaying landscape mode where as it should stay in portrait mode

 

 

 

iOSSimulator17.29.00.png



#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 31 August 2015 - 05:48 PM

Hi gayraud,

 

I am not sure what we're doing differently, but I am really having trouble replicating this. Is there any basic sample that you could attach, or could you kindly let me know how to replicate using any of our bundled samples? Thanks!



#5 gayraud

gayraud

    Jr. Member

  • STV 5.0 Pro
  • PipPip
  • 28 posts
Reputation: 0
Neutral

Posted 31 August 2015 - 10:20 PM

Maybe an information that is important : I am using STV 3.4.2 Pro



#6 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 01 September 2015 - 07:47 AM

Should be still the same architecture when it comes to rotation. It would be great if you could post a sample.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users