MCPcopy Create free account
hub / github.com/9miao/CrossApp / viewDidLoad

Method viewDidLoad

samples/Test/Classes/Control/AlertViewTest.cpp:18–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18void 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
46void AlertViewTest::viewDidUnload()
47{

Callers

nothing calls this directly

Calls 8

DHorizontalLayout_W_CFunction · 0.85
DVerticalLayout_H_CFunction · 0.85
getViewMethod · 0.80
setLayoutMethod · 0.80
setTitleForStateMethod · 0.80
setColorMethod · 0.45
addTargetMethod · 0.45
addSubviewMethod · 0.45

Tested by

no test coverage detected