Problems with UIScrollView: Green Background and No Clipping

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 https://github.com/cocos2d/cocos2d-x/issues

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.

Thanks.

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:
//red,green,blue,alpha,depth,stencil
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};

GLView::setGLContextAttrs(glContextAttrs);

}

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.

@yagoub

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.

@owen i too had the same issue and i posted in lot of pages, but no reply. I also saw the cpp test, where i didnt understand one thing. For scroll view, i could see something like create cross platform view. i dont know what that does

@sillyatom
ScrollViiew implements on top of cocos2d-x and it is platform independent, so what’s your question?

Could you make it more clearer?

@owen createNode(“cocosui/UIEditorTest/UIScrollView/Vertical/crossplatform_UIScrollView_Vertical_Editor_1.csb”);

The name says cross platform. So how it is created? The way it was created is different from others?since the name says “CrossPlatform” explicitly. When all .csb or .json works with all platform why does scrollview alone has this kind of name? Just that triggers the question.

Thanks @owen ,
I have tested cpp-empty-test on the iPad Air after adding these lines of code to the previous ones:

float innerWidth = 840;
auto  innerHeight =  750;
_scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));

This time, there’s no green background on the CCTransitionPageTurn , but it exist on the TransitionFadeBL, TransitionFadeDown , TransitionSplitRows, …

@yagoub

mmm…
Really weird, the most important step is to reproduce this issue on my own computer.
I will investigate and give you my result here.