English 中文(简体)
• 劳动力规模?
原标题:UILabel font size?

我看上去看看看看看看一夫一夫一妻的体积,其代码如下:

itemTitle.font = [UIFont systemFontOfSize:25];

As i increase the number 25 to something greater, it seems to only add a top margin to the label, which consequently pushes the text down so much, so that the text gets cut off at the bottom or completely overflows.

i 别处还有1个PontOfSize 25,比项目Title案文小得多。 什么进展? 第25条是否应当具有绝对价值?

i 如何在方案上改变自食堂面积,这是混淆不清的。

最佳回答

Check that your labels aren t set to automatically resize. In IB, it s called "Autoshrink" and is right beside the font setting. Programmatically, it s called adjustsFontSizeToFitWidth.

问题回答

我已经通过以下法典修改了《劳动法》:

label.font=[label.font fontWithSize:25];

问这个问题,看它是否在你的情况下工作?

[label setFont:[UIFont systemFontOfSize:9]];

这为我工作。

<>Swift 3.1,,Swift 4 and Swift 5,条件是你只想改变贴标签的字体尺寸:

let myLabel : UILabel = ...
myLabel.font = myLabel.font.withSize(25)

**You can set font size by these properties **

timedisplayLabel= [[UILabel alloc]initWithFrame:CGRectMake(70, 194, 180, 60)];

[timedisplayLabel setTextAlignment:NSTextAlignmentLeft];

[timedisplayLabel setBackgroundColor:[UIColor clearColor]];

[timedisplayLabel setAdjustsFontSizeToFitWidth:YES];

[timedisplayLabel setTextColor:[UIColor blackColor]];

[timedisplayLabel setUserInteractionEnabled:NO];

[timedisplayLabel setFont:[UIFont fontWithName:@"digital-7" size:60]];

timedisplayLabel.layer.shadowColor =[[UIColor whiteColor ]CGColor ];

timedisplayLabel.layer.shadowOffset=(CGSizeMake(0, 0));

timedisplayLabel.layer.shadowOpacity=1;

timedisplayLabel.layer.shadowRadius=3.0;

timedisplayLabel.layer.masksToBounds=NO;

timedisplayLabel.shadowColor=[UIColor darkGrayColor];

timedisplayLabel.shadowOffset=CGSizeMake(0, 2);

这为我工作。

<>Swift 3

label.font = label.font.fontWithSize(40.0)

<>Swift 4

label.font = label.font.withSize(40.0)

a. 采用非常简易、但有效的方法,以相应方式调整标示案文的尺寸:

label.font=[UIFont fontWithName:@"Chalkduster" size:36];

:-

这对我的工作是:

sequencerPlayLabel.font = [UIFont fontWithName:kTypeFont size:kTypeFontSize];

- 丰富

上述答复大有助益。

这里是快速版本。

@IBOutlet weak var priceLabel: UILabel!

*.... lines of code later*

self.priceLabel.font = self.priceLabel.font.fontWithSize(22)

C部分 你们可以采取的方法 在调查中,可以找到这些方法。

Label.Font = Label.Font.WithSize(5.0f);
       Or
Label.Font = UIFont.FromName("Copperplate", 10.0f);  
       Or
Label.Font = UIFont.WithSize(5.0f);

要求改变你的贴标签框架的高度和宽度,以便你的案文不会被削减。

 [label setframe:CGRect(x,y,widht,height)];




相关问题
Java (AWT): fitting text in a box

I have an application that extends a Frame. Then, it ll display a few lines of text using: Font f = new Font("Arial", Font.PLAIN, 10); g.setFont(f); g.drawString("Test|great Yes ^.", x, y + 10); Now ...

Embed font into PDF file by using iText

I defined a tag map, and got a XML data file. I want to convert the XML data file to PDF by using iText. The question is how to embed fonts (e.g. Polish font, Chinese font) into the target PDF when ...

Font Rendering between Mozilla and webkit

I m not sure if this has anything to do with the recent Safari update, but I m beginning to notice this a lot. There is a drastic difference in the way each browser is rendering fonts. for instance, ...

Embedding Fonts in AS3 - Dynamic Text Field disappears

This is hopefully a new problem or just me missing something obvious. Please help! I m embedding a font into my AS3 application. I m doing everything by-the-book and it half-works. In my main class, ...

Dynamic GD image width text

I m trying to spice up my website by using custom fonts for headings. For me, the most appropriate way to do this is using PHP and GD. I have written a little script which will output the dynamic text ...

How do I combine @font-face and @media declarations?

I d like to build a common typography stylesheet with a very small number of selectors. As such, I d far prefer to use @media sections for the various versions rather than create different files, each ...

热门标签