Problems with UIScrollView: Green Background and No Clipping

Problems with UIScrollView: Green Background and No Clipping

thanks @owen, I’m using cocos2d-x 3.3rc0

I found that you have defined a new class named PageTransitionFoward.

Could you paste your code here?

I know the issue was related to the stencil buffer of the RenderTexture class.

I you don’t want to paste your code here, you could take a look at this PR:

This issue on the github, it’s already fixed in my cocosd-x

 class PageTransitionForward : public TransitionPageTurn
        static TransitionScene* create(float t, Scene* s)
            return TransitionPageTurn::create(t, s, false);

Does it mean this issue was solved?

or even apply the patch, the problem still exists?

i mean when i looked to my cocos2d-x version , i found it like


 RenderTexture* inTexture = RenderTexture::create((int)size.width, (int)size.height,Texture2D::PixelFormat::RGBA8888,GL_DEPTH24_STENCIL8);

RenderTexture* outTexture = RenderTexture::create((int)size.width, (int)size.height,Texture2D::PixelFormat::RGBA8888,GL_DEPTH24_STENCIL8);


RenderTexture *texture = RenderTexture::create((int)size.width, (int)size.height,Texture2D::PixelFormat::RGBA8888,GL_DEPTH24_STENCIL8);

i’m always having this result:

Have you enabled stencil feature on Android?

you should open appActivity…java and override the function onCreateView()

public Cocos2dxGLSurfaceView onCreateView() {
Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);
glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
return glSurfaceView;

Yes, and the problem still exists on the Android and iOS

really weird…

What’s your cocos2d-x version?
what’s your Android device and Android version?

I’m using cocos2d-x 3.3rc0
iOS devices : ipad air (iOS 7.0.4) , ipad mini (iOS 6.1.3) ,iphone 4(iOS 7)
Android devices: nexus5(android 5) , lenevo idea Tab (android 4.1.2)

Is it working on iOS devices?

no, it is not working on the both android and ios

Does the ScrollView and PageView display green background when you don’t call replaceScene.

This is really very weird, the cpp-tests is working properly.

No, it’s happen only when i call replaceScene

Hi, @yagoub

Could you open a ticket at here

We are busy preparing release cocos2d-x 3.3 final. So I currently don’t have enough time to dig into your issue.

Please open a ticket and I will investigate time to solve it after release v3.3 final.


Hi @owen, any news about my problem ?

I will check it later.

to solve this:
override in AppDelegate.h the following:

virtual void initGLContextAttrs();

in AppDelegate.cpp:

void AppDelegate::initGLContextAttrs()
//set OpenGL context attributions,now can only set six attributions:
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};



this is added in 3.3 to AppDelegate

Thanks @smhmdmjd

@yagoub Have you tried this?

i’m using cocos2d-x V3.3, so i have it.


I have tested cpp-empty-test on iPhone4 with the code you provided and it is working, no green background.

So please test the cpp-empty-test and give me feedback, thanks.