How can I use CClistview in COCOS2d Android?

后端 未结 1 1436
心在旅途
心在旅途 2021-01-15 04:24

I am working on a cocos2d game. In this game, I have to display a score level-wise:

==============================         


        
1条回答
  •  -上瘾入骨i
    2021-01-15 05:06

    I think you are confusing cocos2d for android and cocos2d-x as same sdk. I don't know of any cclistview in Cocos2d. There is one CCTableView in cocos2d. You can find its implementation in the cocos2d library itself. The package org.cocos2d.extension.scroll contains a class CCTableView. You can check its implementation in org.cocos2d.extension.scroll.tests.

    One other way is to inflate native views from android itself like this:

       gameActivity.addContentView(view, new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));    //where gameActivity is an instance of my Activity and view is any inflated layout like this
    
    view = (LinearLayout)LayoutInflater.from(gameActivity).inflate(R.layout.some_listview_layout, null);
    

    0 讨论(0)
提交回复
热议问题