UIView(UIViewExtend) Category Reference

Declared in TuSDKICView+Extend.h

Overview

视图帮助类

+ initWithFrame:

初始化视图快速方法

+ (instancetype)initWithFrame:(CGRect)frame

Parameters

frame

坐标长宽

Return Value

frame 视图

Declared In

TuSDKICView+Extend.h

+ lsqGetRectOnBottomWithView:space:size:

获取相对传入视图底部CGRect

+ (CGRect)lsqGetRectOnBottomWithView:(UIView *)view space:(CGFloat)space size:(CGSize)size

Parameters

view

传入视图

space

底部距离

size

视图大小

Return Value

frame 相对传入视图底部CGRect

Declared In

TuSDKICView+Extend.h

– lsqInitView

初始化视图 (空方法, 默认当使用+(id)initWithFrame:(CGRect)frame;初始化视图时调用)

- (void)lsqInitView

Declared In

TuSDKICView+Extend.h

– lsqSetToBottomWithTarget:space:

设置放置在目标视图下面

- (void)lsqSetToBottomWithTarget:(UIView *)target space:(CGFloat)space

Parameters

target

目标视图

space

距离

Declared In

TuSDKICView+Extend.h

– lsqSetSize:

设置长宽

- (id)lsqSetSize:(CGSize)size

Parameters

size

长宽

Return Value

size 视图对象

Declared In

TuSDKICView+Extend.h

– lsqGetSize

获取长宽

- (CGSize)lsqGetSize

Return Value

lsqGetSize 长宽

Declared In

TuSDKICView+Extend.h

– lsqGetPixiesSize

获取像素长宽

- (CGSize)lsqGetPixiesSize

Return Value

lsqGetSize 长宽

Declared In

TuSDKICView+Extend.h

– lsqSetSizeWidth:

设置宽度

- (id)lsqSetSizeWidth:(CGFloat)width

Parameters

width

宽度

Return Value

width 视图对象

Declared In

TuSDKICView+Extend.h

– lsqGetSizeWidth

获取宽度

- (CGFloat)lsqGetSizeWidth

Return Value

lsqGetSizeWidth 宽度

Declared In

TuSDKICView+Extend.h

– lsqSetSizeHeight:

设置高度

- (id)lsqSetSizeHeight:(CGFloat)height

Parameters

height

高度

Return Value

height 视图对象

Declared In

TuSDKICView+Extend.h

– lsqGetSizeHeight

获取高度

- (CGFloat)lsqGetSizeHeight

Return Value

lsqGetSizeHeight 高度

Declared In

TuSDKICView+Extend.h

– lsqSetOrigin:

设置坐标

- (id)lsqSetOrigin:(CGPoint)origin

Parameters

origin

坐标

Return Value

origin 视图对象

Declared In

TuSDKICView+Extend.h

– lsqGetOrigin

获取坐标

- (CGPoint)lsqGetOrigin

Return Value

lsqGetOrigin 坐标

Declared In

TuSDKICView+Extend.h

– lsqSetOriginX:

设置x坐标

- (id)lsqSetOriginX:(CGFloat)originX

Parameters

originX

x坐标

Return Value

originX 视图对象

Declared In

TuSDKICView+Extend.h

– lsqGetOriginX

获取x坐标

- (CGFloat)lsqGetOriginX

Return Value

x 坐标

Declared In

TuSDKICView+Extend.h

– lsqSetOriginY:

设置y坐标

- (id)lsqSetOriginY:(CGFloat)originY

Parameters

originY

y坐标

Return Value

originY 视图对象

Declared In

TuSDKICView+Extend.h

– lsqGetOriginY

获取y坐标

- (CGFloat)lsqGetOriginY

Return Value

y 坐标

Declared In

TuSDKICView+Extend.h

– lsqGetRightX

获取右边X坐标

- (CGFloat)lsqGetRightX

Return Value

lsqGetRightX 右边X坐标

Declared In

TuSDKICView+Extend.h

– lsqGetBottomY

获取下边Y坐标

- (CGFloat)lsqGetBottomY

Return Value

lsqGetBottomY 下边Y坐标

Declared In

TuSDKICView+Extend.h

– lsqGetRightBottomXY

获取右下角坐标

- (CGPoint)lsqGetRightBottomXY

Return Value

lsqGetRightBottomXY 右下角坐标

Declared In

TuSDKICView+Extend.h

– lsqGetCenterX:

获取目标相对于自己中心的X坐标

- (CGFloat)lsqGetCenterX:(float)targetWidth

Parameters

targetWidth

目标视图宽度

Return Value

centerX 目标相对于自己中心的X坐标

Declared In

TuSDKICView+Extend.h

– lsqGetCenterY:

获取目标相对于自己中心的Y坐标

- (CGFloat)lsqGetCenterY:(float)targetHeight

Parameters

targetHeight

目标视图高度

Return Value

centerYCenterY 目标相对于自己中心的Y坐标

Declared In

TuSDKICView+Extend.h

– lsqGetCenterWithSize:

获取目标相对于自己中心的坐标

- (CGPoint)lsqGetCenterWithSize:(CGSize)size

Parameters

size

目标长宽

Return Value

size 目标相对于自己中心的坐标

Declared In

TuSDKICView+Extend.h

– removeAllSubviews

删除所有子元素

- (void)removeAllSubviews

Declared In

TuSDKICView+Extend.h

– lsqSetBorderWidth:color:

设置边框

- (void)lsqSetBorderWidth:(CGFloat)width color:(UIColor *)color

Parameters

width

边框宽度

color

颜色

Declared In

TuSDKICView+Extend.h

– lsqSetCornerRadius:

设置圆角

- (void)lsqSetCornerRadius:(CGFloat)radius

Parameters

radius

角度

Declared In

TuSDKICView+Extend.h

– rotationWithDegrees:

旋转视图

- (void)rotationWithDegrees:(CGFloat)degrees

Parameters

degrees

角度

Declared In

TuSDKICView+Extend.h

– rotationWithAngle:

旋转视图

- (void)rotationWithAngle:(CGFloat)angle

Parameters

angle

弧度

Declared In

TuSDKICView+Extend.h

– transformToView

将变形应用到视图 防止使用变形后导致视图位置,大小错误 (视图变形后设置大小使用bounds, 位置使用: center)

- (void)transformToView

Declared In

TuSDKICView+Extend.h

– viewWillDestory

视图将要销毁

- (void)viewWillDestory

Declared In

TuSDKICView+Extend.h

– findViewByTag:

查找视图

- (UIView *)findViewByTag:(NSInteger)tag

Parameters

tag

视图Tag

Return Value

view 视图(没有找到返回nil)

Declared In

TuSDKICView+Extend.h

– findViewByTag:needChild:

查找视图, 是否查找子视图

- (UIView *)findViewByTag:(NSInteger)tag needChild:(BOOL)needChild

Parameters

tag

视图Tag

needChild

是否查找子视图

Return Value

view 视图(没有找到返回nil)

Declared In

TuSDKICView+Extend.h

– convertScaleAspectFitWithRatio:

将输入长宽按最大比例换为实际位置长宽

- (CGRect)convertScaleAspectFitWithRatio:(float)ratio

Parameters

ratio

长宽比例

Return Value

ratio 实际位置长宽 (contents scaled to fit with fixed aspect. remainder is transparent)

Declared In

TuSDKICView+Extend.h

– convertScaleAspectFitWithSize:

将输入长宽按最大比例换为实际位置长宽

- (CGRect)convertScaleAspectFitWithSize:(CGSize)size

Parameters

size

长宽

Return Value

size 实际位置长宽 (contents scaled to fit with fixed aspect. remainder is transparent)

Declared In

TuSDKICView+Extend.h

+ convertViewSize:scaleAspectFitWithSize:

将输入长宽按最大比例换为视图位置长宽

+ (CGRect)convertViewSize:(CGSize)viewSize scaleAspectFitWithSize:(CGSize)size

Parameters

viewSize

视图位置

size

长宽

Return Value

size 实际位置长宽 (contents scaled to fit with fixed aspect. remainder is transparent)

Declared In

TuSDKICView+Extend.h

– convertScaleAspectFillWithSize:

将输入长宽按最小比例换为实际位置长宽

- (CGRect)convertScaleAspectFillWithSize:(CGSize)size

Parameters

size

长宽

Return Value

size 实际位置长宽 (contents scaled to fill with fixed aspect. some portion of content may be clipped.)

Declared In

TuSDKICView+Extend.h

+ convertViewSize:scaleAspectFillWithSize:

将输入长宽按最小比例换为视图位置长宽

+ (CGRect)convertViewSize:(CGSize)viewSize scaleAspectFillWithSize:(CGSize)size

Parameters

viewSize

视图位置

size

长宽

Return Value

size 实际位置长宽 (contents scaled to fill with fixed aspect. some portion of content may be clipped.)

Declared In

TuSDKICView+Extend.h