2013-05-09 1 views
0

MapBox 라이브러리가있는지도가 있습니다. *UIView에 25 %가 표시됩니다.

이 잘 작동, 그것은 올바른 표시하는 UIView의에 대한 AKS :

UIView *background = [[[NSBundle mainBundle] loadNibNamed:@"IGBackgroundView" owner:self options:nil] objectAtIndex:0]; 
    [_mapView setBackgroundView:myView]; 

주 setBackgroundView : 는 지금은이 같은 배경을 설정합니다. 내가 원하는 건 배경을 조금 더 멋지게 만드는 것입니다. 내가 사용하여 애니메이션을 적용 할 :이

animationContainer.animationImages = imagesArray; 
animationContainer.animationDuration = 0.5f; 
[animationContainer startAnimating]; 

내가 펜촉 파일의 소유자가 할 수 있도록 컨트롤러를 만들고 싶어 거기에 내가 좋은 깨끗한 물건을 유지하는 코드를 추가 할 수 있습니다합니다.

#import <UIKit/UIKit.h> 

@interface IGBackgroundViewController : UIView 

@property (nonatomic, strong) UIView *view; 

@end 

#import "IGBackgroundViewController.h" 

@implementation IGBackgroundViewController 

- (id)initWithFrame:(CGRect)frame 
{ 
    self = [super initWithFrame:frame]; 
    if (self) { 
     // Initialization code 

     _view = [[[NSBundle mainBundle] loadNibNamed:@"IGBackgroundView" owner:self options:nil] objectAtIndex:0]; 

     [self addSubview:_view]; 
    } 
    return self; 
} 


@end 

그리고 내가 사용하는 배경 설정 : 이제

난이

IGBackgroundViewController *background = [[IGBackgroundViewController alloc] init]; 

    [_mapView setBackgroundView:background]; 

그것은 작동을하지만, 전체의 25 %처럼 보여줍니다 nib and result

이 문제가 발생하는 이유는 무엇입니까?

p.s. iOS 개발을 처음 접했습니다.

답변

1

자동 크기 조정에주의하십시오!

아마도 Interface Builder에서 잘못된 점을 설정했을 것입니다. 앱을 실행하면보기가 다른 위치로 이동했을 것입니다.

enter image description here

희망이 도움이됩니다.

+0

크기 검사기에서 "show frame rectangle"원점, x, y, 너비 및 높이를 찾을 수 있습니다. 그러나 자동 크기 조정 기능은 없습니다. – clankill3r

관련 문제