代码改变世界

随笔档案-2011年11月22日

创建按钮的两种方法

2011-11-22 13:48 by Mr.Xer, 496 阅读, 收藏,
摘要: 1、动态创建1btnfont=[UIButtonbuttonWithType:UIButtonTypeRoundedRect];2[btnfontsetFrame:CGRectMake(100,10,120,40)];3[btnfontaddTarget:selfaction:nilforControlEvents:UIControlEventTouchUpInside];4[btnfontsetTitle:@"字体"forState:UIControlStateNormal];5btnfont.backgroundColor=[UIColorclearColor];6[s 阅读全文