【代码笔记】iOS-长条蓝色button
生活随笔
收集整理的這篇文章主要介紹了
【代码笔记】iOS-长条蓝色button
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一,效果圖。
二,代碼。
ViewController.m
- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view, typically from a nib.//添加設備 UIButton *deviceButton=[UIButton buttonWithType:UIButtonTypeRoundedRect]; deviceButton.frame=CGRectMake((self.view.frame.size.width-320)/2, 100, 320, 38); [deviceButton setTitle:@"添加設備" forState:UIControlStateNormal]; deviceButton.backgroundColor=[UIColor colorWithRed:59/255.0 green:89/255.0 blue:152/255.0 alpha:1.0]; deviceButton.titleLabel.textColor=[UIColor whiteColor]; [deviceButton setTintColor:[UIColor whiteColor]]; [deviceButton addTarget:self action:@selector(doClickDeviceButton:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:deviceButton]; } #pragma -mark -doClickActions //添加設備 -(void)doClickDeviceButton:(UIButton *)btn { NSLog(@"---doClickDeviceButton----"); }轉載于:https://www.cnblogs.com/yang-guang-girl/p/7337525.html
總結
以上是生活随笔為你收集整理的【代码笔记】iOS-长条蓝色button的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Bable实现由ES6转译为ES5
- 下一篇: Mybatis使用generator自动