首頁>Club>
2
回覆列表
  • 1 # 使用者5342110859641

    //宣告void touchButton(Object* object,TouchEventType type);//掛接到控制元件上uiButton->addTouchEventListener(this,toucheventselector(HelloWorld::touchButton));//實現void HelloWorld::touchButton(Object* object,TouchEventType type){ LabelTTF* label; switch (type) { case TouchEventType::TOUCH_EVENT_BEGAN: label = static_cast<LabelTTF*>(getChildByTag(11)); label->setString("按下按鈕"); break; case TouchEventType::TOUCH_EVENT_MOVED: label = static_cast<LabelTTF*>(getChildByTag(11)); label->setString("按下按鈕移動"); break; case TouchEventType::TOUCH_EVENT_ENDED: label = static_cast<LabelTTF*>(getChildByTag(11)); label->setString("放開按鈕"); break; case TouchEventType::TOUCH_EVENT_CANCELED: label = static_cast<LabelTTF*>(getChildByTag(11)); label->setString("取消點選"); break; default: break; }}你需要實現onclick()

  • 中秋節和大豐收的關聯?
  • 當前社會離婚率越來越高,到底是什麼原因引起的?