2

我一直在查看答案和文档,但找不到有关此主题的任何内容。我对IOS开发相当陌生,所以希望这个问题与这里有关。

我有一个 TableView,用户在单元格上向右滑动,标签的字体大小会增加。但是,为了根据设计规范进行制作,我还需要增加字体粗细。这是我目前使用的:

self.infoLabel.font = [UIFont fontWithName:self.textLabel.font.familyName size:20 + 20*_intensityPercentage];

我看过的其他方法似乎只能打开/关闭粗体,但是我需要不断地调整它。

我面临的 TableViewCell 的另一个问题是,UILabel 会在向左滑动时变得更模糊。这甚至可能吗?

任何帮助深表感谢。谢谢!

4

1 回答 1

4

Per Is there a medium weight font between -systemFontOfSize: and -boldSystemFontOfSize:?, iOS doesn't support dynamic font weight. But since many fonts that ship with iOS ship with 3 or more "weights" within the font family you likely have more control available than normal / bold. For example, you might be able to dynamically rotate through HelveticaNeue-UltraLight to HelveticaNeue-Light to HelveticaNeue to HelveticaNeue-Medium to HelveticaNeue-Bold.

Check out http://www.iosfonts.com for a good dump of what fonts and weights are available to different versions of iOS.

于 2013-05-21T00:19:03.530 回答