您的位置:首页 > 其它

一像素约束(选中所需约束,切换到类处,选择此类,运行时就是0.5的约束)

2016-01-14 15:40 260 查看
#import <UIKit/UIKit.h>
/**
*  @author songxing, 16-01-14 15:01:14
*
*  一像素约束(选中所需约束,切换到类处,选择此类,运行时就是0.5的约束)
*/
@interface NSLayoutConstraintOnePixelLine : NSLayoutConstraint

@end


#import "NSLayoutConstraintOnePixelLine.h"

@implementation NSLayoutConstraintOnePixelLine

- (void)awakeFromNib {
[super awakeFromNib];

if (self.constant == 1) {
self.constant = 1 / [UIScreen mainScreen].scale;
}

}

@end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: