alibaba / VirtualView-iOS

A solution to create & release UI component dynamically.
MIT License
507 stars 77 forks source link

所有frame的计算为什么要取整数?这样会导致问题吧 #5

Closed zekunyan closed 6 years ago

zekunyan commented 6 years ago

比如均分的时候,375的屏幕均分成4份肯定不准的。

// VVViewObject
- (void)layoutSubviews{
    //
    CGFloat x = self.frame.origin.x;
    CGFloat y = self.frame.origin.y;
    _width = _width<0?self.superview.frame.size.width:_width;
    _height = _height<0?self.superview.frame.size.height:_height;
    CGFloat a1,a2,w,h;
    a1 = (int)x*1;
    a2 = (int)y*1;
    w = (int)_width*1;
    h = (int)_height*1;
    self.frame = CGRectMake(a1, a2, w, h);
}
HarrisonXi commented 6 years ago

目前的取整算法比较不准确,的确会有问题,已经考虑进行优化。正在排期解决。

HarrisonXi commented 6 years ago

release 1.2.2 已解决