iPad App景观模式破坏了iOS 8.3

时间:2015-06-25 13:29:17

标签: ios objective-c iphone ipad

我有一个适用于iPad的应用程序,该应用程序只有横向左右方向..就像打印屏幕:

The app is only landscape orientation

我正在使用以下代码将视图旋转为横向模式:

SELECT date_part('h',convert_timezone('UTC+05:30',  value)) as h  ,  
       count (CASE WHEN cond1 THEN 1 else null END) AS "result1",
       count (CASE WHEN cond2 THEN 1 else null END) AS "result2"
FROM table_name
WHERE conds
GROUP BY cols

Expected Output:
h | result1 | result2

1 |   23    |   51
2 |   45    | 100

Actual Output:
h | result1 | result2

  |     0   |   0
  |     0   |   0                            
1 |   23    |   51

和xib:

The xib

它运行良好..但现在在iOS 8.3中它不起作用。看似错误......见图:

enter image description here

1 个答案:

答案 0 :(得分:0)

为viewController对象设置自动布局约束。 并且不需要在didFinishLaunchingWithOptions

中写下你的代码
[[UIApplication sharedApplication]setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
 CGAffineTransform rotate = CGAffineTransformMakeRotation(M_PI/2);
 [self.window setTransform:rotate];
 [self.window setFrame:CGRectMake(0, 0, 768, 1024)];