• orientation in a UIView add to a UIWindow


    UIView *customView;
    UIWindow *window = [[[UIApplication sharedApplication] keyWindow] addSubview:customView];
    
    in the ViewController:shouldAutorotateToInterfaceOrientation
    
      switch (interfaceOrientation) {
    
     
    
            case UIInterfaceOrientationLandscapeLeft:
    
                customView.transform = CGAffineTransformMakeRotation(-M_PI /2.0);
    
                break;
    
            case UIInterfaceOrientationLandscapeRight:
    
                customView.transform = CGAffineTransformMakeRotation(M_PI /2.0);
    
                break;
    
            case UIInterfaceOrientationPortraitUpsideDown:
    
                customView.transform = CGAffineTransformMakeRotation(M_PI);
    
                break;
    
            default:
    
                customView.transform = CGAffineTransformMakeRotation(0.0);
    
                break;
    
        }
    
        return YES;

    reference:

    http://stackoverflow.com/questions/2508630/orientation-in-a-uiview-added-to-a-uiwindow

    http://stackoverflow.com/questions/3353571/custom-uiwindow-orientation

  • 相关阅读:
    VB6之GDI+加载PNG图片
    VB6之阴影图层
    VB6之截图
    VB6之调整任务栏按钮的位置
    恐怖的ifdown eth0;0
    VB6之WM_COPYDATA
    删除整个链表
    digest 词根 gest
    new和delete
    static, const
  • 原文地址:https://www.cnblogs.com/horo/p/2535123.html
Copyright © 2020-2023  润新知