首页 > 代码库 > 带下划线的注册按钮
带下划线的注册按钮
先上效果图。
上代码:
- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. //初始化按钮 [self initRegisterButton];}#pragma -mark -funcitons-(void)initRegisterButton{ //注册账号按钮 UIButton *registerButton=[UIButton buttonWithType:UIButtonTypeRoundedRect]; registerButton.frame=CGRectMake(50,100, 100, 20); registerButton.backgroundColor=[UIColor clearColor]; [registerButton setTitle:@"注册账号" forState:UIControlStateNormal]; [registerButton addTarget:self action:@selector(doClickRegisterButton:) forControlEvents:UIControlEventTouchUpInside]; registerButton.titleLabel.textColor=[UIColor colorWithRed:144.0/255.0 green:144.0/255.0 blue:144.0/255.0 alpha:0.8]; [self.view addSubview:registerButton]; //注册账号下的线 UIImageView *line=[[UIImageView alloc]initWithFrame:CGRectMake(registerButton.frame.origin.x+10, registerButton.frame.origin.y+registerButton.frame.size.height, 100, 1)]; line.backgroundColor=[UIColor colorWithRed:144.0/255.0 green:144.0/255.0 blue:144.0/255.0 alpha:0.3]; [self.view addSubview:line];}#pragma -mark -doClickButton-(void)doClickRegisterButton:(UIButton *)btn{ NSLog(@"--doClickRegisterButton--");}
带下划线的注册按钮
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。