을적인 Cocos2D 내 게임에 appoxee 메시지 서비스를 사용하고 있습니다 ..있는 UIButton 잘못된 계층에 나타납니다 -
내 첫 번째 층 StageLayer 로딩이 완료 될 때까지 "StartUpLayer"StartUpLayer 기다리는입니다 .. 어디 레이어를 무대에 올라가면 UIButton이 선언되었습니다 ..
그러나 UIButton은 StartUpLater에 처음으로 나타나며 출시 될 때까지 거기에 머물러 있습니다. 어떻게이 문제를 해결할 수 있습니까? 감사합니다 ..
AppDelegate에
- (void) AppoxeeNeedsToUpdateBadge:(int)badgeNum hasNumberChanged:(BOOL)hasNumberChanged
{
if(badgeNum > 0)
{
badgeText = [NSString stringWithFormat:@"%d",badgeNum];
}
StageLayer *stgLayer = [[StageLayer alloc] init];
[[AppoxeeManager sharedManager] addBadgeToView:stgLayer.AppoxeeButton badgeText:badgeText badgeLocation:CGPointMake(0,0) shouldFlashBadge:hasNumberChanged];
[UIApplication sharedApplication].applicationIconBadgeNumber = badgeNum;
}
단계 계층 초기화
AppoxeeButton = [[UIButton alloc] initWithFrame:CGRectMake(100,100,100,100)];
[AppoxeeButton setBackgroundImage:[UIImage imageNamed:@"messages-button.png"] forState:UIControlStateNormal];
[AppoxeeButton setTitle:@"" forState:UIControlStateNormal];
[AppoxeeButton addTarget:self action:@selector(inboxPressed) forControlEvents:UIControlEventTouchUpInside];
[[[CCDirector sharedDirector] openGLView] addSubview:AppoxeeButton];
사실 .. 나는 [[[CCDirector sharedDirector] openGLView] addSubview : AppoxeeButton];을 init에서 -onEnterTransitionDidFinish' 메소드로 이동하고 문제가 해결되었습니다. – user1526474