2011-03-09 62 views
0

在我cocos2D上(cocos2d的0.99.5版本)项目i集成一个UIView如下面的代码的UITableView在cocos2d(不能选择行)

tView = [[UIView alloc] initWithFrame:CGRectMake(-90,85,480,320)]; // ypo,xpos,width,height 
    CGAffineTransform tr = tView.transform; // get current transform (portrait) 
    tr = CGAffineTransformRotate(tr, (M_PI/2.0)); // rotate 90 degrees to go landscape 
    tView.transform = tr; // set current transform (landscape) 
    [[[CCDirector sharedDirector] openGLView] addSubview:tView]; 

,并添加一个UITableView为孩子tView像这个

tTableView = [[UITableView alloc] initWithFrame:CGRectMake(0,50,480,320) 

                 style:UITableViewStylePlain]; 

tTableView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 

tTableView.delegate = self; 

tTableView.dataSource = self; 

[tTableView reloadData]; 

[self.pView addSubview:tTableView]; 

UITableView添加正确,但我不能在tableview.it中选择一行滚动以及。如何解决这个问题。请给点建议

谢谢。

回答

1

您可能需要查看带有下载页面和示例here的UITableView CCTableView套件的Cocos2D版本。这比将UIKit视图与Cocos2D混合起来要好得多。