成績:完成下圖中右邊的按鈕文字後果
辦法:
[MyTools createMyImageview:topEditView frame:CGRectMake(widthAll-90, 12, 17, 16) imageName:@"離線課程_下載更多.png"]; UIButton *downMoreButton = [MyTools createMyBtn:@"下載更多" frame:CGRectMake(widthAll-70, 10, 60, 20) uiview:topEditView uifont:14 color:[UIColor colorWithRed:92/255.0 green:218/255.0 blue:231/255.0 alpha:1]]; NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:@"下載更多"]; NSRange titleRange = {0,[title length]}; [title addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:titleRange]; [downMoreButton setAttributedTitle:title forState:UIControlStateNormal]; [downMoreButton.titleLabel setFont:[UIFont systemFontOfSize:14]]; [downMoreButton addTarget:self action:@selector(downMore) forControlEvents:UIControlEventTouchUpInside];
關於IOS 按鈕上的文字添加下劃線的辦法就給年夜家引見到這裡,願望對年夜家有所贊助!
【iOS 按鈕上的文字添加下劃線的辦法】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!