if(textView.text.length >20)//一行最多多少字节
{
//TextView底面背景图片根据内容自动调整高度
UIImage *img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"inputbox"ofType:@"png"]]
[BgImage setImage:[img stretchableImageWithLeftCapWidth:21 topCapHeight:14]]
UIFont *font = [UIFont systemFontOfSize:12]
CGSize size = [textView.text sizeWithFont:font constrainedToSize:CGSizeMake(320, 140)lineBreakMode:UILineBreakModeWordWrap]
BgImage.frame = CGRectMake(0, 202-size.height+15, 320, size.height+28)
InputTextVeiw.contentInset = UIEdgeInsetsZero//以换行为基准
[textView setFrame:CGRectMake(51, 210-size.height+18, 200, size.height+5)]
如果你问的是UILable的话你可以这样:UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 21)]
if (label) {
// 设置文本内容
label.text = @"aaaaaaaaaaaaa"
// 0代表不限制行数
[label setNumberOfLines:0]
// 因为行数不限制,所以这里在宽度不变的基础上(实际宽度会略为缩小),高度会自动扩充
[label sizeToFit]
[self.view addSubview:label]
[label release]
}
如果你问的是TextView的话直接把高度设置成wrap_content就可以了。希望可以帮到你
使用coreldraw时怎样设置字体高度和宽度?关于美术文本 字宽和字高可以用测量的方法先拉辅助线确定辅助的上下距离,或者画一个和字的高度和宽带相等的矩形然后拉动美术文本适合高度和宽度。和可以用矩形设定字的宽度和高度,然后打一个字,拉成和矩形高和宽相等的字体,按F8键在字后点击打字即可。
jfreechar 柱状图categoryaxis 怎样设置字体宽度Java代码
String FONT="宋体"
JFreeChart localJFreeChart = ChartFactory.createBarChart(this.title, "", "金额(元)", paramCategoryDataset, PlotOrientation.VERTICAL, false, true, false)
localJFreeChart.setBackgroundPaint(new Color(255, 255, 255))
CategoryPlot localCategoryPlot = (CategoryPlot)localJFreeChart.getPlot()
CategoryAxis localCategoryAxis = localCategoryPlot.getDomainAxis()
localCategoryAxis.setMaximumCategoryLabelWidthRatio(0.8F)
localCategoryAxis.setLowerMargin(0.02D)
localCategoryAxis.setUpperMargin(0.02D)
NumberAxis localNumberAxis = (NumberAxis)localCategoryPlot.getRangeAxis()
localNumberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits())
BarRenderer localBarRenderer = (BarRenderer)localCategoryPlot.getRenderer()
localBarRenderer.setDrawBarOutline(false)
[color=red] GradientPaint localGradientPaint = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, Color.white)[/color] localBarRenderer.setSeriesPaint(0, localGradientPaint)
TextTitle textTitle = localJFreeChart.getTitle()
textTitle.setFont(new Font(FONT, Font.PLAIN, 20))
CategoryPlot plot = localJFreeChart.getCategoryPlot()
CategoryAxis domainAxis = plot.getDomainAxis()
ValueAxis rAxis = plot.getRangeAxis()
/*------设置X轴坐标上的文字-----------*/
domainAxis.setTickLabelFont(new Font(FONT, Font.PLAIN, 12))
/*------设置X轴的标题文字------------*/
domainAxis.setLabelFont(new Font(FONT, Font.PLAIN, 12))
/*------设置Y轴坐标上的文字-----------*/
rAxis.setTickLabelFont(new Font(FONT, Font.PLAIN, 12))
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_45)
/*------设置Y轴的标题文字------------*/
rAxis.setLabelFont(new Font(FONT, Font.PLAIN, 12))
return localJFreeChart
红字是设置柱的颜色及样式。
设置最高值与最低值以及中间值,你说这种估计不行吧。有几个柱状都是根据数据自动生成的。颜色也是统一设置的。
在coreldraw X4中怎样设置黑体字的高度与宽度应该说:首先单击字体工具按扭,再在页面上单击,输入字体,然后使用快捷键“Ctrl+t”,出现字体设置对话框,有字体的大小,或用字体转换成图形,就可以直接设置高和宽。
coreldraw9制作条码怎样设置高度和宽度啊点条码 Ctrl+X -编辑-选择性粘贴-图片原文件-解散群组- 条码下有一个垃圾色块 删除掉 就可以更改大小了虽然你没给分啊 也帮你解决下
机械制图中autocad文字设置字体和字体高度都设置成多少?
文字字体设置为GBZ,仿宋字体
标准图框1:1字高设置3.5
按比例放大或缩小字高,字体一样,仍为仿宋体
爱剪辑字体设置怎样调整字体高度点击你的字幕~页面中间有一个字体设置小版块,在大小处调整你要的字体大小就行啦~
怎样设置textview里字体宽度那你标题的说法,难道是想设置每个字的宽度,那高度不变,字不就变形了字大了你可以设置字体的大小size啊,如果是显示区域你可以设置textview的显示区域的宽和高啊
怎样设置cad字体宽度比列两个方法:
1、修改文字样式:格式-文字样式-宽度比例;这个对所有使用该样式的文字对象有效,前提是该对象没有单独修改过特性;
2、单独修改某文字对象的高宽比:选中该文字,点“特性”按钮,修改宽度比例数值。
怎样使用91桌面设置字体91桌面上的字体没有应用到整个系统,
他只是在在桌面功能范畴内显示的,如果想整个系统显示的话只有手机root后用字体管家之类的软件去安装字体就OK了!求采纳
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)