当前位置:首页 > Windows程序 > 正文

UIView全部API的学习。

2021-05-25 Windows程序

标签:uiview   ios开发uiview全部api   

/********* UIViewiOS系统界面元素的基础,所有的界面元素都是集成自它。它本身完全是由CoreAnimation来实现的。它真正的绘图部分,是一个叫CALayer(Core Animation Layer)的类来管理的。UIView本身,更像是一个CALayer的管理器,访问它的跟绘图和跟坐标有关的属性,例如frame,bounds等等,实际上内部都是在访问它所包含的CALayer的相关属性 *********/

//1.View设置动画块中的动画属性变化的曲线

typedef NS_ENUM(NSInteger, UIViewAnimationCurve) {

UIViewAnimationCurveEaseInOut,         // slow at beginning and end

UIViewAnimationCurveEaseIn,            // slow at beginning

UIViewAnimationCurveEaseOut,           // slow at end

UIViewAnimationCurveLinear

};

//2.View内部内容不同显示类型效果

typedef NS_ENUM(NSInteger, UIViewContentMode) {

UIViewContentModeScaleToFill,

    UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent

    UIViewContentModeScaleAspectFill,     // contents scaled to fill with fixed aspect. some portion of content may be clipped.

    UIViewContentModeRedraw,              // redraw on bounds change (calls -setNeedsDisplay)

    UIViewContentModeCenter,              // contents remain same size. positioned adjusted.

UIViewContentModeTop,

UIViewContentModeBottom,

UIViewContentModeLeft,

UIViewContentModeRight,

UIViewContentModeTopLeft,

UIViewContentModeTopRight,

UIViewContentModeBottomLeft,

UIViewContentModeBottomRight,

};

//3.五种动画效果

typedef NS_ENUM(NSInteger, UIViewAnimationTransition) {

UIViewAnimationTransitionNone, 没有动画

UIViewAnimationTransitionFlipFromLeft, 从左向右旋转翻页

UIViewAnimationTransitionFlipFromRight,从右向左旋转翻页

UIViewAnimationTransitionCurlUp, 卷曲翻页,从下往上

UIViewAnimationTransitionCurlDown, 卷曲翻页 从上往下

};

//4.这些属性是为了自动调整子控件与父控件中间的位置,宽高

typedef NS_OPTIONS(NSUInteger, UIViewAutoresizing) {

UIViewAutoresizingNone                 = 0, 不自动调整

UIViewAutoresizingFlexibleLeftMargin   = 1 << 0,自动调整与superView左边的距离,保证与superView左边的距离不变

UIViewAutoresizingFlexibleWidth        = 1 << 1,自动调整自己的宽度,保证与superView左边和右边的距离不变

UIViewAutoresizingFlexibleRightMargin  = 1 << 2,自动调整与superView的右边距离,保证与superView左边的距离不变

UIViewAutoresizingFlexibleTopMargin    = 1 << 3,自动调整与superView顶部的距离,保证与superView底部的距离不变

UIViewAutoresizingFlexibleHeight       = 1 << 4,自动调整自己的高度,保证与superView左边和邮编的距离不变

UIViewAutoresizingFlexibleBottomMargin = 1 << 5,自动调整与superView底部的距离,保证与superView顶部的距离不变

};

//4.关于动画Option的一些可选项

typedef NS_OPTIONS(NSUInteger, UIViewAnimationOptions) {

UIViewAnimationOptionLayoutSubviews            = 1 <<  0, 提交动画的时候布局子控件,表示子控件将和父控件一同动画

UIViewAnimationOptionAllowUserInteraction      = 1 <<  1, 动画时允许用户交流,比如触摸 

UIViewAnimationOptionBeginFromCurrentState     = 1 <<  2, 从当前状态开始动画

UIViewAnimationOptionRepeat                    = 1 <<  3, 动画无限重复

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/70987.html