zoukankan      html  css  js  c++  java
  • 【代码笔记】iOS-按钮带下划线的写法

    一,效果图。

    二,工程图。

    三,代码。

    RootViewController.h

    RootViewController.m

    复制代码
    - (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--");
    }
    复制代码
  • 相关阅读:
    CNN网络改善的方法——池化
    tensorflow 卷积层
    CNN输出维度的计算
    CNN滤波器
    CNN如何识别一幅图像中的物体
    什么是卷积?
    windows 和 linux 安装 tensorflow
    终端安装opencv
    css3圆形光环闪烁效果
    微信小程序
  • 原文地址:https://www.cnblogs.com/yang-guang-girl/p/5011952.html
Copyright © 2011-2022 走看看