[英]Scrollview in Cocos2d - android
How to Implement Scrolling functionality in cocos2d Surfaceview in android? 如何在android中的cocos2d Surfaceview中实现滚动功能? Please give me some suggestion. 请给我一些建议。
There is no scroll view available in cocos2d, but check the below details if it can help you. cocos2d中没有可用的滚动视图,但请检查以下详细信息是否可以帮助您。
This example for screen reslution 320 x 480. 此示例用于屏幕重新分析320 x 480。
Hope it will work for you and if any other details required then comment on this 希望它能为您服务,如果需要任何其他细节,请对此进行评论
You can direct add android ui scrollview in cocos2d-android 1 like that 你可以直接在cocos2d-android 1中添加android ui scrollview
Activity mActivity=CCDirector.sharedDirector().getActivity();
View view=(LinearLayout) LayoutInflater.from(mActivity).inflate(R.layout.level_scroll,null);
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
mActivity.addContentView(view, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
}
}); });
You can make level_scroll.xml as per your requirement. 您可以根据您的要求制作level_scroll.xml。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.