如何垂直对齐状态栏项目文本? [英] How can I vertically align my status bar item text?

查看:108
本文介绍了如何垂直对齐状态栏项目文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

图片上的左一个是来自Apple的日期和时间,一个是我的应用程序.如您所见,我的应用程序的文本似乎比Apple的文本小.看起来不太漂亮.该如何解决?

Left one on the picture is the date and time from Apple and one is my application one. As you may see the text of my application appears lower than the Apple one. Which doesn't look pretty. How can this be resolved?

self.statusBarItem.image                    = nil
self.statusBarItem.button?.imagePosition    = .NoImage
self.statusBarItem.button?.title            = "Sun 5 Jun  13:35"

推荐答案

您可以按偏移量进行操作.您不能这样做,因为它需要在状态项按钮栏上完成.

You could do it in offset. You cannot do it like this since it needs to be done on the status item button bar.

button.frame = CGRectMake(0.0, 0.5, button.frame.width, button.frame.height)

这篇关于如何垂直对齐状态栏项目文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆