zoukankan      html  css  js  c++  java
  • 给button增加下划线

    如何给button增加下划线简单版
     

    - (void)setUnderLineForButton:(UIButton *)btn withTitle:(NSString *)title{

        //利用富文本的方式增加button下划线

        NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithString:title];

        NSRange strRange = {0,[str length]};

        [str addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:strRange];

        [btn setAttributedTitle:str forState:UIControlStateNormal];

    }

  • 相关阅读:
    合并字符串中的多个空格
    IfcSpecularRoughness
    IfcSpecularExponent
    IfcPresentableText
    IfcFontWeight
    IfcFontVariant
    uwb ifc模型定位測試
    IfcFontStyle
    IfcGeometricModelResource
    qt6安装
  • 原文地址:https://www.cnblogs.com/lsnow/p/9889471.html
Copyright © 2011-2022 走看看