• FirstApp,iphone开发学习总结9,旋转


    添加Rotation文件,用类别为UITabBarController添加旋转:

    //Rotation.h文件
    #import <Foundation/Foundation.h>

    @interface UITabBarController(Rotation)
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)x;
    @end

     Rotation.m文件:

    #import "Rotation.h"

    @implementation UITabBarController(Rotation)
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)x {
        return YES;
    }

    @end

    在ButtonViewController.m文件中添加:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)x
    {
        return YES;//此处判定方向,达到要求才旋转
    }

    //此时可以旋转了

    修改right按钮,修改ButtonViewController.h:

    @interface ButtonViewController : UIViewController{
        UIButton *rightBtn;
    }
    @end

     修改ButtonViewController.m文件内的- (void)viewDidLoad:

    - (void)viewDidLoad
    {
        //..
        rightBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];//修改
        //..
        [rightBtn setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];//添加,此处可用 |
        
        //..
    }

     

    不是很具体,这是总结。

    求指点~

  • 相关阅读:
    关于mysql主从架构master宕机
    恢复drop后的表空间
    rman 恢复drop 表空间模拟恢复
    backup controlfile 和create standby controlfile
    catalog
    rman恢复表(不完全恢复)--需要关闭数据库
    rman备份恢复
    oracle DG 启动和关闭顺序
    ASM-本地数据拷贝
    图解Java设计模式之模板模式
  • 原文地址:https://www.cnblogs.com/maxfong/p/2489582.html
Copyright © 2020-2023  润新知