我已将导航控制器titleTextAttributes设置为使用自定义字体,为此使用了以下代码
[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"Neon80s" size:21],NSFontAttributeName, nil]];我想给这个加个颜色吗?如果我单独使用自定义字体,它会高估它,所以我猜测的颜色需要包含在上面的方法中吗?
发布于 2015-02-24 11:20:42
如我所见,Neon80s在iOS中不可用。但是对于字体大小为21和文本颜色为Arial的red,您可以使用下面的代码。
[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"Arial" size:21],NSFontAttributeName,[UIColor redColor],NSForegroundColorAttributeName ,nil]];https://stackoverflow.com/questions/28694098
复制相似问题