搜索
您的当前位置:首页正文

UILabel(下滑\删除线)

来源:哗拓教育

设置label中划线、下划线

``` python

//设置中划线(删除线)

NSDictionary*dic = @{NSStrikethroughStyleAttributeName:[NSNumbernumberWithInteger:NSUnderlineStyleSingle],NSFontAttributeName:KSYSTEM_FONT_12,NSForegroundColorAttributeName:KCOLOR_GRAY_LIGHT};NSString*str = [NSStringstringWithFormat:@"¥%.2f",[list.marketPricefloatValue]];NSMutableAttributedString*oldPriceAtt = [[NSMutableAttributedStringalloc] initWithString:str attributes:dic];

//设置下划线

NSDictionary*dic = @{NSUnderlineStyleAttributeName:[NSNumbernumberWithInteger:NSUnderlineStyleSingle]};NSMutableAttributedString*attribtStr = [[NSMutableAttributedStringalloc]initWithString:@"123"attributes:dic];

``` 

Top