zoukankan      html  css  js  c++  java
  • iOS 按钮文字加划掉线

    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(20, 50, 120, 40)];
        
        NSDictionary *normalTitleAttributes = @{
                                                NSForegroundColorAttributeName: [UIColor blueColor],
                                                NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle)
                                                };
        NSAttributedString *normalAttributedTitle = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Button", nil) attributes:normalTitleAttributes];
        [btn setAttributedTitle:normalAttributedTitle forState:UIControlStateNormal];
        
        // Set the button's title for highlighted state.
        NSDictionary *highlightedTitleAttributes = @{
                                                     NSForegroundColorAttributeName : [UIColor blueColor],
                                                     NSStrikethroughStyleAttributeName: @(NSUnderlineStyleThick)
                                                     };
        NSAttributedString *highlightedAttributedTitle = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Button", nil) attributes:highlightedTitleAttributes];
        [btn setAttributedTitle:highlightedAttributedTitle forState:UIControlStateHighlighted];
        
        [btn addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
        
        [self.view addSubview:btn];
  • 相关阅读:
    哈希表--扩展数组
    哈希表效率
    P=(1+1/(1-L))/2
    函数推进
    简单函数2
    简单函数
    getting data from the keybroad
    nutch-2.2.1 hadoop-1.2.1 hbase-0.92.1 集群部署(实用)
    hbase zookeeper独立搭建
    Orchard 介绍
  • 原文地址:https://www.cnblogs.com/lihaibo-Leao/p/4424998.html
Copyright © 2011-2022 走看看