Abh*_*nav 5 iphone cocoa-touch objective-c uibutton ios
我正在绘制自定义UIButton并希望在突出显示时设置蓝色.我怎样才能做到这一点?
UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom];
[myButton setBackgroundImage:[[UIImage imageNamed:@"test.png"] stretchableImageWithLeftCapWidth:100 topCapHeight:0] forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)
您可以尝试使用其他图像来完成这项工作。您也可以参考这个链接:
| 归档时间: |
|
| 查看次数: |
22524 次 |
| 最近记录: |