MapBox ライブラリを使用したマップがあります。今、私はこのように背景を設定します:
UIView *background = [[[NSBundle mainBundle] loadNibNamed:@"IGBackgroundView" owner:self options:nil] objectAtIndex:0];
[_mapView setBackgroundView:myView];
注 setBackgroundView: UIView* の aks
これはうまく機能し、正しく表示されます。私が望むのは、背景をもう少し派手にすることです。私はそれを使ってアニメーション化したい:
animationContainer.animationImages = imagesArray;
animationContainer.animationDuration = 0.5f;
[animationContainer startAnimating];
nib がファイル所有者を持つことができるようにコントローラーを作成したいので、そこにコードを追加して物事をきれいに保つことができます。
今私が持っています:
#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% のように表示されます。
なぜこれが起こるのか誰にも分かりますか?
PS私はiOS開発にかなり慣れていません。