有时候我们需要给文字添加横线,有两种情况: 第一种是贯穿中间的横线: 横线的颜色和文字的颜色保持一致 _oldPriceLabel.text = "; _oldPriceLabel.textColor = [UIColor lightGrayColor]; NSMutableAttributedString *newPrice = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"…
@property(nonatomic , strong) TTTAttributedLabel * ttLabel; @property(nonatomic , strong) NSRange lineboldRange; @property(nonatomic , strong) NSRange lineboldRange1; 全局变量 _ttLabel = [[TTTAttributedLabelalloc]initWithFrame:CGRectMake(,,self.view.widt…
一.介绍 最近项目有一个需求,需要给朗诵的文字添加对应的拼音,而且要求使用原生的控件实现.一开始听到这个需求挺懵逼的,感觉有点难.后来,静下来想一下,其实还是可以实现的,无非就是自定义了.下面,就来说说思想. 二.思想 server端首先返回汉字和拼音一一对应的字符串,我们根据需要分别截取存入数组.一个汉字要添加拼音,拼音使用一个view显示,汉字也使用一个view显示,那么包含这两个控件的则是一个父view.许多个父view根据横向瀑布流的布局排列,就可以实现需要的汉字添加拼音的效果.结构图如…
环境: 在一个透明的view中添加一个tableview,tableview也变透明了. 解决: 不要这样设置view的透明度 view.backgroundColor = [UIColor clearColor]; view.alpha = 0.8; 应该这样设置 view.backgroundColor = [[UIColor whiteColor]colorWithAlphaComponent:0.7f];…
在删除的时候,先删除数据源,再删除cell 但是,会发现一直崩: numberOfRowsInSection 解决方案:…
可以利用Tabview的separatorStyle属性来设置,选择其中的UITableViewCellSeparatorStyleNone 即可去除cell之间的下划线 self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;…
css 的text-decoration可以实现文字下方的下划线,但是距离文字比较近,不是很好看,我们可以使用border-bottom来模拟这个效果 (inline元素虽然不可以设置margin-top和margin-bottom,但是可以设置padding值和border) body{ margin: 0; } div { width: 500px; margin: 50px auto; } span { padding-bottom:2px; color: red; border-bott…
原文:Inno Setup技巧[界面]欢迎页面上添加文字 本文介绍在"欢迎页面添加文字"的两种方法. 界面预览: Setup技巧[界面]欢迎页面上添加文字" title="Inno Setup技巧[界面]欢迎页面上添加文字"> 首先可以在[Code]段添加以下代码: procedure InitializeWizard(); var LabelDate: Tlabel; begin WizardForm.WelcomeLabel2.Autosize…
//直接代码 只包含 折叠展开字典的处理搭建#import "CFViewController.h" @interface CFViewController ()<UITableViewDelegate,UITableViewDataSource> { UITableView *CFTableView; //数据 NSArray * CFOnearray; NSMutableArray *CFArray; NSArray *CFDetailArray; CGFloat He…
import PIL from PIL import ImageFont from PIL import Image from PIL import ImageDraw #设置字体,如果没有,也可以不设置 font = ImageFont.truetype("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf",13) #打开底版图片 imageFile = "base.png" im1=Image.open(im…