{"action":"closed","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/8431","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/8431/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/8431/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/8431/events","html_url":"https://github.com/cocos2d/cocos2d-x/issues/8431","id":44414681,"number":8431,"title":"[v3.0stable]ControlSwitch not displayed properly on Android device","user":{"login":"minggo","id":488203,"avatar_url":"https://avatars.githubusercontent.com/u/488203?v=3","gravatar_id":"","url":"https://api.github.com/users/minggo","html_url":"https://github.com/minggo","followers_url":"https://api.github.com/users/minggo/followers","following_url":"https://api.github.com/users/minggo/following{/other_user}","gists_url":"https://api.github.com/users/minggo/gists{/gist_id}","starred_url":"https://api.github.com/users/minggo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minggo/subscriptions","organizations_url":"https://api.github.com/users/minggo/orgs","repos_url":"https://api.github.com/users/minggo/repos","events_url":"https://api.github.com/users/minggo/events{/privacy}","received_events_url":"https://api.github.com/users/minggo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/labels/type:bug","name":"type:bug","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/milestones/22","html_url":"https://github.com/cocos2d/cocos2d-x/milestones/unconfirmed","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/milestones/22/labels","id":1080226,"number":22,"title":"unconfirmed","description":"","creator":{"login":"walzer","id":345379,"avatar_url":"https://avatars.githubusercontent.com/u/345379?v=3","gravatar_id":"","url":"https://api.github.com/users/walzer","html_url":"https://github.com/walzer","followers_url":"https://api.github.com/users/walzer/followers","following_url":"https://api.github.com/users/walzer/following{/other_user}","gists_url":"https://api.github.com/users/walzer/gists{/gist_id}","starred_url":"https://api.github.com/users/walzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walzer/subscriptions","organizations_url":"https://api.github.com/users/walzer/orgs","repos_url":"https://api.github.com/users/walzer/repos","events_url":"https://api.github.com/users/walzer/events{/privacy}","received_events_url":"https://api.github.com/users/walzer/received_events","type":"User","site_admin":false},"open_issues":217,"closed_issues":67,"state":"open","created_at":"2015-04-23T08:44:11Z","updated_at":"2015-08-31T09:21:59Z","due_on":"2015-11-29T16:00:00Z","closed_at":null},"comments":1,"created_at":"2014-09-30T09:15:12Z","updated_at":"2015-08-31T09:21:59Z","closed_at":"2015-08-31T09:21:59Z","body":"# Note\n\n This issue is migrated from [here](http://www.cocos2d-x.org/issues/5004). It was created at 2014/05/03 10:36:31 +0000\n# Description\n\nControlSwitch is not displayed properly on my Android phone([HTC Evo 4G](http://en.wikipedia.org/wiki/HTC_Evo_4G) 2.3.4).\r\nMy code is copied from the cpp-tests.\r\n```\r\n    ControlSwitch *switchControl = ControlSwitch::create\r\n    (\r\n     Sprite::create(\"extensions/switch-mask.png\"),\r\n     Sprite::create(\"extensions/switch-on.png\"),\r\n     Sprite::create(\"extensions/switch-off.png\"),\r\n     Sprite::create(\"extensions/switch-thumb.png\"),\r\n     Label::createWithTTF(\"On\", \"fonts/Marker Felt.ttf\", 16),\r\n     Label::createWithTTF(\"Off\", \"fonts/Marker Felt.ttf\", 16)\r\n     );\r\n    \r\n    auto l = Node::create();\r\n    l->addChild(switchControl);\r\n    l->setContentSize(Size(80, 0));\r\n    l->setPosition(Point(100, 100));\r\n    addChild(l);\r\n```\n# Comments\n\n\n* sodaigomi added comment:\nThere is no problems on iOS devices\n\n* sodaigomi added comment:\nI managed to find the reason. \r\nIn android you need to enable the Stencil buffer while in iOS it is already enabled.\r\nIn the AppActivity.java, modify as follows\r\n```\r\n    public Cocos2dxGLSurfaceView onCreateView() {\r\n        Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);\r\n        // TestCpp should create stencil buffer\r\n        glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);\r\n        \r\n        return glSurfaceView;\r\n    }\r\n```\n"}}