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;

时间: 2024-08-10 02:11:06

UIViewContentMode的相关文章

UIViewContentMode 图文解说

在iOS应用开发中我们常常要对视图的contentMode属性进行设置,尤其在使用UIImageView视图时设置这个属性的概率很高.我们知道contentMode的类型是UIViewContentMode的枚举,那么其每个值是什么含义,设置后会有什么效果呢?下面就来总结下. UIViewContentModeLeft 如果将UIImageView对象的contentMode设置为UIViewContentModeLeft,其内部的图片会按照原有的尺寸大小,以垂直居中,水平居左的方式显示.见UI

UIViewContentMode各类型效果

UIViewContentMode typedef enum {    UIViewContentModeScaleToFill,    UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent    UIViewContentModeScaleAspectFill,     // contents scaled to fill with

iOS UIViewContentMode详解

根据定义可以看出 UIViewContentMode 是UIView的属性,所以这里分别对UIImageView.UIView.UILabel.UIButton设置contentMode属性来查看相应效果. 通过测试可以看到,contentMode属性的设置,在视觉上只对UIImageView起作用,对UIView.UILabel.UIButton都不起作用. 对于UIView,因为它的子视图都已经设置了自己的frame,位置是固定的,所以这里contentMode不起作用. 对于UILabel

UIViewContentMode各类型效果(UIImageView)

UIViewContentMode typedef enum {    UIViewContentModeScaleToFill,    UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent    UIViewContentModeScaleAspectFill,     // contents scaled to fill with

UIViewContentMode详解

UIView有个UIViewContentMode类型的属性contentMode,可以通过它来修改视图的内容显示模式. typedef NS_ENUM(NSInteger, UIViewContentMode) { UIViewContentModeScaleToFill, UIViewContentModeScaleAspectFit, // contents scaled to fit with fixed aspect. remainder is transparent UIViewCo

UIViewContentMode的各种效果

UIViewContentMode的各种效果: 首先它是枚举类型的数据,表示为下所示: typedef enum { UIViewContentModeScaleToFill,             // default value    UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent    UIViewContentModeS

UIImageView的UIViewContentMode区别

UIImageView的contentMode常用的有三种,分别是 1.强制填充,ImageView,可能会造成图片拉伸挤压变形,一般不会使用 UIViewContentModeScaleToFill 2.按比例缩放,此种模式会按照比例显示,大小有可能不会填充整个ImageView,可能会缩小,内容不会被剪切 UIViewContentModeScaleAspectFit 3.按比例填充,此种模式会按照ImageView和照片的比例来填充,照片多余的部分会被剪切 UIViewContentMod

iOS开发中didSelectRowAtIndexPath tap事件响应延迟

为UITableViewCell添加tapped事件,代码如下: class VideoViewController: UIViewController , UITableViewDataSource,UITableViewDelegate { //... func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) { // 播放框背景图片 let imageName : Str

Objective - C学习笔记:UIView的使用方法

1.1 - (void)layoutSubviews; * 当一个控件的frame发生改变的时候就会自动调用 * 一般在这里布局内部的子控件(设置子控件的frame) * 一定要调用super的layoutSubviews方法 1.2 - (void)didMoveToSuperview; * 当一个控件被添加到父控件中就会调用 1.3 - (void)willMoveToSuperview:(UIView *)newSuperview; * 当一个控件即将被添加到父控件中会调用 @interf