2013-05-02 100 views
0

在Interface Builder中我构建了这个视图。该1S是UIButtonsUICustom按钮缩放比例错误

enter image description here

但iPhone 6模拟器,它看起来像这样

enter image description here

我在一个水平滚动UIScrollView设置这些意见的6彼此相邻。

[self.slips setContentSize:CGSizeMake(1842.0f, 322.0f)]; 

self.slip1 = [[Slip alloc]initWithFrame:CGRectMake(0.0f, 0.0f, 307.0f, 322.0f)]; 
[self.slips addSubview:self.slip1]; 

self.slip2 = [[Slip alloc]initWithFrame:CGRectMake(307.0f, 0.0f, 307.0f, 322.0f)]; 
[self.slips addSubview:self.slip2]; 

self.slip3 = [[Slip alloc]initWithFrame:CGRectMake(614.0f, 0.0f, 307.0f, 322.0f)]; 
[self.slips addSubview:self.slip3]; 

self.slip4 = [[Slip alloc]initWithFrame:CGRectMake(921.0f, 0.0f, 307.0f, 322.0f)]; 
[self.slips addSubview:self.slip4]; 

self.slip5 = [[Slip alloc]initWithFrame:CGRectMake(1228.0f, 0.0f, 307.0f, 322.0f)]; 
[self.slips addSubview:self.slip5]; 

self.slip6 = [[Slip alloc]initWithFrame:CGRectMake(1535.0f, 0.0f, 307.0f, 322.0f)]; 
[self.slips addSubview:self.slip6]; 

哪里slipsUIScrollView

slip1UIView一个子类,并设置这样

- (id)initWithFrame:(CGRect)frame { 
self = [super initWithFrame:frame]; 
    if (self) { 
    // Initialization code. 
    // 
    [[NSBundle mainBundle] loadNibNamed:@"LottoSlip" owner:self options:nil]; 
    [self addSubview:self.rootView]; 
    } 
    return self; 
} 

有人可以帮忙,为什么UIButtons被错误地安排? 在此先感谢。

回答

0

如果别人有问题。我使用与自定义UIButtons尺寸完全相同的图像以及具有加倍尺寸和命名约定的图像版本对其进行了修复。

imageName.png 

[email protected] 

和现在的工作。

0

请到五金检查设备并选择如上图所示,图像..

enter image description here

+0

它在模拟器的不同设备设置上有同样的问题。 – dan 2013-05-02 08:04:09

+0

请检查您的查看在笔尖/参数 – hitesh 2013-05-02 08:11:48

+0

非常感谢您的帮助,但我在哪里可以找到您发布的列表,我没有检查这一点呢。我无法在项目的plist中找到它。我也不知道在哪里找到Nib /参数请原谅我的不知情。 – dan 2013-05-02 08:15:12