等待测试storyboard的自适应

//

//storyBoard view自动适配

+ (void)storyBoradAutoLay:(UIView *)allView

{

    for (UIView *temp in allView.subviews) {

        temp.frame = CGRectMakeMyself(temp.frame.origin.x, temp.frame.origin.y, temp.frame.size.width, temp.frame.size.height);

        for (UIView *temp1 in temp.subviews) {

            temp1.frame = CGRectMakeMyself(temp1.frame.origin.x, temp1.frame.origin.y, temp1.frame.size.width, temp1.frame.size.height);

        }

    }

}

//修改CGRectMake

CG_INLINE CGRect

CGRectMakeMyself(CGFloat x, CGFloat y, CGFloat width, CGFloat height)

{

    AppDelegate *myDelegate = [[UIApplication sharedApplication] delegate];

    CGRect rect;

    rect.origin.x = x * myDelegate.autoSizeScaleX;

    rect.origin.y = y * myDelegate.autoSizeScaleY;

    rect.size.width = width * myDelegate.autoSizeScaleX;

    rect.size.height = height * myDelegate.autoSizeScaleY;

    return rect;

}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值