这是我的代码:
// View Controller with navigation bar
InAppPurchaseViewController *purchaseViewController = [[InAppPurchaseViewController alloc] init];
purchaseViewController.title = @"Magasin";
purchaseViewController.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissViewController:)] autorelease];
UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:purchaseViewController] autorelease];
// Add `purchaseViewcontroller` TO container AND container ON openGLView
UIViewController *container = [[UIViewController alloc] init];
[container setView:[[CCDirector sharedDirector] openGLView]];
[container setModalTransitionStyle: UIModalTransitionStyleCoverVertical];
[container presentViewController:navController animated:YES completion:nil];
UITableView
在purchaseViewController中。
我曾考虑使用[UIColor clearColor]
,但不管我用它在哪里,我的UITableView
都有黑色背景。单元格变得不可选择和滑动(除了单元格内的元素)。
编辑:appdelegate
这是.h文件。
@class AudioEngine;
@class RootViewController;
@class Score;
@interface AppDelegate : NSObject <UIApplicationDelegate, GameCenterManagerDelegate>
@property int CurrentPackage;
@property int CurrentScore;
@property int CurrentHighScore;
@property BOOL SoundShouldPlay;
@property BOOL PauseScreenUp;
@property(nonatomic, retain) AudioEngine *CustomAudioEngine;
@property(nonatomic, retain) GameCenterManager *CustomGameCenterManager;
@property(nonatomic, retain) UIWindow *window;
@property(nonatomic, readonly) RootViewController *ViewController;
@property(nonatomic, retain) NSString* CurrentLeaderBoard;
@property(nonatomic, retain) NSMutableArray *TenLastScoresArray;
+(AppDelegate *)get;
-(void)connectToGameCenter;
-(void)addScoreToLastScore:(Score*)score;
方法已经完成启动
-(void)applicationDidFinishLaunching:(UIApplication*)application
{
CC_DIRECTOR_INIT();
self.CurrentLeaderBoard = kLeaderboardID;
[[SKPaymentQueue defaultQueue] addTransactionObserver:[InAppPurchaseSingleton sharedHelper]];
[AudioEngine preloadBackgroundMusic];
[AudioEngine playBackgroundMusic:3];
self.SoundShouldPlay = YES;
[SceneManager goSplash];
}
UITableView
和UITableViewCell
设置背景为[UIColor clearColor]
。2- 为UITableView
和UITableViewCell
设置Opaque
为NO
。 - Mazyod[container setView:[[CCDirector sharedDirector] openGLView]];
然后看看会发生什么吗?只是为了澄清一下是否存在 UITableView 和 Cocos2D 之间的某种故障... - sergio