示例#1
0
void AlertViewTest::respondTouch(CAControl* btn ,CCPoint point)
{
	CCSize size = this->getView()->getBounds().size;
	std::vector<std::string> btnTitle;
	CAAlertView* alertView = CAAlertView::create();
	btnTitle.push_back("green");
	btnTitle.push_back("yeelow");
	btnTitle.push_back("orange");
	alertView->showMessage("ButtonImage", "What kind of background of button do you like?", btnTitle);
	alertView->setTarget(this, CAAlertView_selector(AlertViewTest::alertViewCallback));
}
void FirstViewController::diss(CAControl* sender, CCPoint point)
{
    this->dismissModalViewController(true);
    
    CAAlertView* alert = CAAlertView::create();
    std::vector<std::string> s;
    for (int i = 0; i < CCRANDOM_0_1() * 5; i++)
    {
        char str[10];
        sprintf(str, "button_%d", i);
        s.push_back(str);
    }
    
    alert->showMessage("title", "message", s);
}