In the use of UIButton, you need to implement UIButton to the left of the picture, the picture immediately following the text effect is more trouble, the simple implementation of the specific code is as follows:
(void) Viewdidload {[Super viewdidload];
Self.view.backgroundColor = RGB (235, 235, 240);
UIButton *onebutton = [[UIButton alloc] Initwithframe:cgrectmake (0, Kheaderheight + 8, Kscreenwidth, 40)]; [Onebutton setimage:[uiimage imagenamed:@ "Icon_party_knowledge_rights_obligations"] ForState:UIControlStateNormal
];
[Onebutton settitle:@ "The first" forstate:uicontrolstatenormal];
OneButton.titleLabel.font = Font (12);
[Onebutton Settitlecolor:[uicolor Blackcolor] forstate:uicontrolstatenormal];
[Onebutton Setimageedgeinsets:uiedgeinsetsmake (2, 8, 0, kScreenWidth-50)];
[Onebutton settitleedgeinsets:uiedgeinsetsmake (0, 0, 0, kScreenWidth-100)];
Onebutton.backgroundcolor = [Uicolor Whitecolor];
[Onebutton addtarget:self Action: @selector (onebuttonaction:) forcontrolevents:uicontroleventtouchupinside];
[Self.view Addsubview:onebutton];
UIButton *twobutton = [[UIButton alloc] Initwithframe:cgrectmake (0, Onebutton.maxy + 8, Kscreenwidth, 40)]; [Twobutton Setimage:[uiimAge imagenamed:@ "Icon_party_knowledge_dues_collection_standard"] forstate:uicontrolstatenormal];
[Twobutton settitle:@ "The second" forstate:uicontrolstatenormal];
TwoButton.titleLabel.font = Font (12);
[Twobutton Settitlecolor:[uicolor Blackcolor] forstate:uicontrolstatenormal];
[Twobutton Setimageedgeinsets:uiedgeinsetsmake (2, 8, 0, kScreenWidth-50)];
[Twobutton settitleedgeinsets:uiedgeinsetsmake (0, 0, 0, kScreenWidth-100)];
Twobutton.backgroundcolor = [Uicolor Whitecolor];
[Twobutton addtarget:self Action: @selector (twobuttonaction:) forcontrolevents:uicontroleventtouchupinside];
[Self.view Addsubview:twobutton]; Right arrow for (int i = 0; i < 2; i++) {Uiimageview *rightimgview = [[Uiimageview alloc] Initwithframe:cgrectmake (kSc
reenWidth-20, Kheaderheight + + i * 48, 7, 12)];
Rightimgview.image = [UIImage imagenamed:@ "Icon_right"];
[Self.view Addsubview:rightimgview];
}
}
Implementation effect:
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.