2014-11-26 2 views
0

누구든지이 코드 블록을 사용하면 화면 크기에 맞게 화면 크기가 조정되지 않습니다. 있는 그대로 xib 파일을로드하고 장치의 너비에 맞지 않는 것 같습니다. 당신이 슈퍼 initWithFrame라고 후에는의 경우 블록에 자신을 재 할당하는iOS - Loading a xib

-(void) bookNowAction 
{ 
    ReciptView *v = [[ReciptView alloc] initWithFrame:self.view.frame]; 
    [self.view addSubview:v]; 
} 

답변

0

:

- (instancetype)initWithFrame:(CGRect)frame 
{ 
    self = [super initWithFrame:frame]; 
    if (self) { 
     NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ReceiptView" owner:self options:NULL]; 
     self = (ReciptView *)[nib objectAtIndex:0]; 

    } 
    return self; 
} 

는 그리고 이것은 컨트롤러에서 구현 한 것입니다. 근본적으로 그 전화의 효과를 지워 버리고 있습니다.