cocos2d-x 2.2.6 uisilder 无法拖动????

cocos2d::ui::UISlider* slider = cocos2d::ui::UISlider::create();
    
    slider->setTouchEnabled(true);
    slider->loadBarTexture("set/shzh_ank.png");
    slider->loadSlidBallTextures("set/shzh_an.png", "set/shzh_an.png", "");
    slider->loadProgressBarTexture("set/shzh_ant.png");
    slider->setPosition(ccp(300, 300));
    slider->addEventListenerSlider(this, sliderpercentchangedselector(HelloWorld::sliderEvent));

    this->addChild(slider);



```


还需要设置什么吗????
UICheckBox* checkBox = UICheckBox::create();
    checkBox->setTouchEnabled(true);
    checkBox->loadTextures("check_box_normal.png",
                           "check_box_normal_press.png",
                           "check_box_active.png",
                           "check_box_normal_disable.png",
                           "check_box_active_disable.png");
    checkBox->setPosition(ccp(300, 300));
    this->addChild(checkBox);



```


在新工程helloworld中在添加checkBox也按不了,
到底还要设置什么?????

我这边新建了个工程测试了下,这两个都是正常的。我和你代码唯一的不同,就是我用的新工程里面的图片。

请检查下是否是由于其他原因引起的。

谢谢版主,解决了是2.2.6 控件都有添加到uilayer上,3.x好像不用

我也加在uilayer上,但是还是不能正常拖动,我用的是2.2.3的