| 16 | } |
| 17 | |
| 18 | void AlertViewTest::viewDidLoad() |
| 19 | { |
| 20 | this->getView()->setColor(CAColor_gray); |
| 21 | |
| 22 | //初始化viewList |
| 23 | CAButton* btn1 = CAButton::create(CAButtonTypeRoundedRect); |
| 24 | btn1->setLayout(DLayout(DHorizontalLayout_W_C(240, 0.5), DVerticalLayout_H_C(54, 0.25))); |
| 25 | btn1->setTag(100); |
| 26 | btn1->setTitleForState(CAControlStateAll, "Click-1"); |
| 27 | btn1->addTarget(this, CAControl_selector(AlertViewTest::alertButtonCallBack), CAControlEventTouchUpInSide); |
| 28 | this->getView()->addSubview(btn1); |
| 29 | |
| 30 | CAButton* btn2 = CAButton::create(CAButtonTypeRoundedRect); |
| 31 | btn2->setLayout(DLayout(DHorizontalLayout_W_C(240, 0.5), DVerticalLayout_H_C(54, 0.5))); |
| 32 | btn2->setTag(200); |
| 33 | btn2->setTitleForState(CAControlStateAll, "Click-2"); |
| 34 | btn2->addTarget(this, CAControl_selector(AlertViewTest::alertButtonCallBack), CAControlEventTouchUpInSide); |
| 35 | this->getView()->addSubview(btn2); |
| 36 | |
| 37 | CAButton* btn3 = CAButton::create(CAButtonTypeRoundedRect); |
| 38 | btn3->setLayout(DLayout(DHorizontalLayout_W_C(240, 0.5), DVerticalLayout_H_C(54, 0.75))); |
| 39 | btn3->setTag(300); |
| 40 | btn3->setTitleForState(CAControlStateAll, "Click-3"); |
| 41 | btn3->addTarget(this, CAControl_selector(AlertViewTest::alertButtonCallBack), CAControlEventTouchUpInSide); |
| 42 | this->getView()->addSubview(btn3); |
| 43 | |
| 44 | } |
| 45 | |
| 46 | void AlertViewTest::viewDidUnload() |
| 47 | { |
nothing calls this directly
no test coverage detected