UIView的ContentMode

UIViewContentMode

typedef enum {
    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,
} UIViewContentMode;

UIView的ContentMode

时间: 2024-12-08 23:02:13

UIView的ContentMode的相关文章

UIView的contentMode中scale和aspect的字面意思

scale的意思是:缩放,在contentMode中出现的话,就是要改变图形的大小了. aspect的意思是纵横的比例,在contentMode中的意思是保持图形的纵横比,保持图片不变形. scale aspect fill:在保持纵横比(aspect)的前提下,缩放图片(scale),使图片充满容器(fill). scale aspect fit: 在保持纵横比(aspect)的前提下,缩放图片(scale),使图片在容器内都显示出来(fit). scale to fill:缩放图片,使图片充

iOS图片填充UIImageView(contentMode)

本文主要形象的介绍一下UIView的contentMode属性: 核心代码 [self.prp_imageView setContentMode:UIViewContentModeScaleAspectFill]; self.prp_imageView.clipsToBounds = YES;   UIViewContentModeScaleAspectFit, //这个图片都会在view里面显示,并且比例不变 这就是说 如果图片和view的比例不一样 就会有留白如下图1 UIViewConte

UIView的几个枚举定义

UIView是iOS开发最主要的视图,非常多控件都是继承它,掌握当中的几个基本枚举定义,有利益理解视图的载入和參数差别. 一.UIViewAnimationCurve UIView的基本动画变化规律 typedef NS_ENUM(NSInteger, UIViewAnimationCurve) { UIViewAnimationCurveEaseInOut, // 淡入淡出 UIViewAnimationCurveEaseIn, // 開始时慢 UIViewAnimationCurveEase

IOS Core Animation Advanced Techniques的学习笔记(一)

转载. Book Description Publication Date: August 12, 2013 Core Animation is the technology underlying Apple’s iOS user interface. By unleashing the full power of Core Animation, you can enhance your app with impressive 2D and 3D visual effects and creat

我的IOS学习资源收录

IOS7视频教程-storyboard与UIApplication http://v.youku.com/v_show/id_XNzMxMjgwNzEy.html 关东升老师的ios视频教程 iPhone与iPad开发实战-ios经典应用剖析-7大项目实战开发 1第1讲工具类应用密码生成(Amuck Password Generator)57分钟   2第2讲工具类应用密码生成(Amuck Password Generator)52分钟   3第3讲工具类应用--密码生成(Amuck Passw

Core Animation学习总结

目录: The Layer Beneath The Layer Tree(图层树) The Backing Image(寄宿层) Layer Geometry(图层几何学) Visual Effects(视觉效果) Transforms(变换) Specialized Layers(专有图层) Setting Things in Motion Implicit Animations(隐式动画) Explicit Animations(显式动画) Layer Time(图层时间) Easing(缓

iOS 开发之照片框架详解之二 —— PhotoKit 详解(上)

一. 概况 本文接着 iOS 开发之照片框架详解,侧重介绍在前文中简单介绍过的 PhotoKit 及其与 ALAssetLibrary 的差异,以及如何基于 PhotoKit 与 AlAssetLibrary 封装出通用的方法. 这里引用一下前文中对 PhotoKit 基本构成的介绍: PHAsset: 代表照片库中的一个资源,跟 ALAsset 类似,通过 PHAsset 可以获取和保存资源 PHFetchOptions: 获取资源时的参数,可以传 nil,即使用系统默认值 PHAssetCo

整理一下CoreGraphic和Quartz2D的知识(一)

1.Quartz 2D是什么? •Quartz 2D以PDF的规范为基础的图形库,用来绘制二维文字和图形,允许相同的绘图指令在任何装置上,使用可以得到的最佳分辨率,产生相同的输出. 2.Quartz2D能做什么? •Quartz 2D API可以实现许多功能,如基于路径的绘图.透明度.阴影.颜色管理.反锯齿.PDF文档生成和PDF元数据访问等 3.Quartz2D和CoreGraphic什么关系 •Quartz 2D API是Core Graphic框架的一部分,因此其中的很多数据类型和方法都是

swift详解之二十四---------------CoreAnimation(一)CALayer

CoreAnimation(一)CALayer CoreAnimation 算是一个大话题 ,要实现很多炫酷的动画,必须掌握它,掌握它之前 ,先来了解CALayer - 图层 CALayer 我们平常都是用UIView 来构建应用,CALayer 是图层的一个属性 ,view.layer . 它和UIview一样都是一些被层级关系树管理的矩形块 ,如果玩儿过PS ,就会对图层的概念比较清晰 .CALayer 也可以包含一些一些内容(像图片,文本或者背景色),管理子图层的位置,也有一些方法和属性用