UIView之【UIViewContentMode】

1. UIViewContentMode

typedef NS_ENUM(NSInteger, UIViewContentMode) {
    UIViewContentModeScaleToFill,

    UIViewContentModeScaleAspectFit,

    UIViewContentModeScaleAspectFill,

    UIViewContentModeRedraw, 

    UIViewContentModeCenter,
    UIViewContentModeTop,
    UIViewContentModeBottom,
    UIViewContentModeLeft,
    UIViewContentModeRight,
    UIViewContentModeTopLeft,
    UIViewContentModeTopRight,
    UIViewContentModeBottomLeft,
    UIViewContentModeBottomRight,
};

2.各類模式的圖示

原圖比例:code

原圖

▽UIViewContentModeScaleToFillit

UIViewContentModeScaleToFill

▽UIViewContentModeScaleAspectFit方法

UIViewContentModeScaleAspectFit

▽UIViewContentModeScaleAspectFillim

UIViewContentModeScaleAspectFit

▽UIViewContentModeLeftimg

UIViewContentModeLeft

==============================================co

//用於視圖的縮放或重設尺寸

//會強制調用drawRect:方法來相應視圖變化

//不該該在標準視圖中使用該模式

UIViewContentModeRedraw,

相關文章
相關標籤/搜索