zoukankan      html  css  js  c++  java
  • 【iOS】UIButton 常用属性

    发现 UIButton 的相关属性不熟悉了……常用的一些属性代码如下:

       UIButton *add = [UIButton buttonWithType:UIButtonTypeCustom];
        add.frame = CGRectMake(WIDTH-80, 20, 60, 30);
        add.layer.masksToBounds = YES;
        add.layer.cornerRadius = 8.0;
        add.layer.borderWidth = 1.0; //边框宽度
        add.backgroundColor = [UIColor whiteColor];
    //    add.titleLabel.backgroundColor = [UIColor blueColor];
    
        [add setTitle:@"Add" forState:UIControlStateNormal];
        [add setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];    
        [self.view addSubview:add];
        [add addTarget:self action:@selector(addSth) forControlEvents:UIControlEventTouchUpInside];

    效果如图所示:

  • 相关阅读:
    欧拉定理证明&阶乘的逆元
    Tree POJ
    GCD
    java42
    java41
    java
    java40
    搭建两个网站的琐碎问题
    虚拟机从无到有,服务器从无到有的历程(在更)
    java39
  • 原文地址:https://www.cnblogs.com/jaxer/p/5580652.html
Copyright © 2011-2022 走看看