iOS-枚举的<<

作者: linbj | 来源:发表于2017-06-22 11:17 被阅读21次
enum UIViewAutoresizing {
UIViewAutoresizingNone = 0,
UIViewAutoresizingFlexibleLeftMargin = 1 << 0,
UIViewAutoresizingFlexibleWidth = 1 << 1,
UIViewAutoresizingFlexibleRightMargin = 1 << 2,
UIViewAutoresizingFlexibleTopMargin = 1 << 3,
UIViewAutoresizingFlexibleHeight = 1 << 4, 
UIViewAutoresizingFlexibleBottomMargin = 1 << 5,
}”

这个<<是什么意思?

位操作法,即往左移动N位,举个例子,1的二进制表示是1,往左移一位就是10。这种枚举是一般叫做option。举个例子UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth就是 01 | 10 即11

顺便提一下动画的枚举


0A7BB0BB-621A-4548-807D-4475164E4EF5.png
typedef NS_OPTIONS(NSUInteger, UIViewAnimationOptions) {
  UIViewAnimationOptionLayoutSubviews            = 1 <<  0, //提交动画的时候布局子控件,表示子控件将和父控件一同动画。
    UIViewAnimationOptionAllowUserInteraction      = 1 <<  1,  //动画时允许用户交流,比如触摸
    UIViewAnimationOptionBeginFromCurrentState     = 1 <<  2, //从当前状态开始动画
    UIViewAnimationOptionRepeat                    = 1 <<  3, //动画无限重复
    UIViewAnimationOptionAutoreverse               = 1 <<  4,  //执行动画回路,前提是设置动画无限重复
    UIViewAnimationOptionOverrideInheritedDuration = 1 <<  5, //忽略外层动画嵌套的执行时间
    UIViewAnimationOptionOverrideInheritedCurve    = 1 <<  6,  //忽略外层动画嵌套的时间变化曲线
    UIViewAnimationOptionAllowAnimatedContent      = 1 <<  7, //通过改变属性和重绘实现动画效果,如果key没有提交动画将使用快照
    UIViewAnimationOptionShowHideTransitionViews   = 1 <<  8, //用显隐的方式替代添加移除图层的动画效果
    UIViewAnimationOptionOverrideInheritedOptions  = 1 <<  9, //忽略嵌套继承的�选项
    UIViewAnimationOptionCurveEaseInOut            = 0 << 16,//时间曲线函数,由慢到快
    UIViewAnimationOptionCurveEaseIn               = 1 << 16, //时间曲线函数,由慢到特别快
    UIViewAnimationOptionCurveEaseOut              = 2 << 16, //时间曲线函数,由快到慢
    UIViewAnimationOptionCurveLinear               = 3 << 16,//时间曲线函数,匀速
    UIViewAnimationOptionTransitionNone            = 0 << 20, //无转场动画
    UIViewAnimationOptionTransitionFlipFromLeft    = 1 << 20,//转场从左翻转
    UIViewAnimationOptionTransitionFlipFromRight   = 2 << 20, //转场从右翻转
    UIViewAnimationOptionTransitionCurlUp          = 3 << 20,//上卷转场
    UIViewAnimationOptionTransitionCurlDown        = 4 << 20,//下卷转场
    UIViewAnimationOptionTransitionCrossDissolve   = 5 << 20,//转场交叉消失
    UIViewAnimationOptionTransitionFlipFromTop     = 6 << 20,//转场从上翻转
    UIViewAnimationOptionTransitionFlipFromBottom  = 7 << 20,//转场从下翻转

} NS_ENUM_AVAILABLE_IOS(4_0);

相关文章

  • iOS-枚举的<<

    这个<<是什么意思? 位操作法,即往左移动N位,举个例子,1的二进制表示是1,往左移一位就是10。这种枚举是一般叫...

  • Read a story

    This is a lion. lt's big. lt's strong. lt has big teeth. ...

  • Mybatis中特殊符号转移

    1. 写法1 原符号替换符号<<<=<=>>>=>=<><>&&'&a...

  • Read a story

    lt's hot?? lt's cool here. lt's a hat. What's this? Do yo...

  • 芯科通信招聘fw固件工程师

    职责描述 工作职责:lt;/pgt;lt;pgt;1、负责光模块firmware的软件设计、维护以及优化;lt;/...

  • test

    <script>alert(1);</script>

  • 无标题文章

    <script>alert('hello’);</script>

  • 打卡第47天

    Attention is vitality. lt connects you with others. lt ma...

  • 2018-10-08

    线性系统的LT分析法一、数学角度1、对微分方程进行LT分析eg:同求LT变换得到2、对电路进行LT处理对于线性电路...

  • Listen and enjoy

    lt can be bitter. lt can be sweet. Sometimes it's black. ...

网友评论

    本文标题:iOS-枚举的<<

    本文链接:https://www.haomeiwen.com/subject/vnoxcxtx.html