简介:ios开发之字体样式设置大全
ios开发之字体样式设置大全
在ios开发中,字体样式设置是一个非常重要的环节,因为它直接关系到应用的美观度和易用性。本文将介绍ios开发中常用的字体样式设置方法,包括字体、字号、字体颜色、粗细、行高、字体大小、斜体、下划线、连字符、换行符等。
一、字体
NSString *fontName = @"Helvetica";
self.fontName = [NSString stringWithFormat:@"%@", fontName];self.fontSize = 20.0;
self.fontName = [NSString stringWithFormat:@"%@", fontName];self.type = UIFontTypeCustom;
self.fontName = [NSString stringWithFormat:@"%@", fontName];self.type = UIFontTypeRegular;self.style = UIFontStyleRegular;
二、字号
self.fontSize = 20.0;
self.fontName = [NSString stringWithFormat:@"%@", fontName];self.type = UIFontTypeCustom;self.style = UIFontStyleItalic;self.fontSize = 20.0;
self.fontName = [NSString stringWithFormat:@"%@", fontName];self.type = UIFontTypeRegular;self.fontSize = 20.0;
三、字体颜色
self.fontName = [NSString stringWithFormat:@"%@", fontName];self.type = UIFontTypeCustom;self.textColor = [UIColor whiteColor];
self.fontName = [NSString stringWithFormat:@"%@", fontName];self.type = UIFontTypeRegular;self.textColor = [UIColor whiteColor];
四、粗细
```objective
self.fontName = [NSString stringWithFormat:@”%@”, fontName];