让 UIBarButtonItem 指向右侧的标准方法?
当新的视图控制器被推入导航堆栈时,标准支持带有前一个视图控制器标题的后退按钮。该按钮“指向”左侧而不是圆角矩形。
是否有标准方法来创建“指向”右侧的 UIBarButtonItem?该按钮将用作 rightBarButtonItem。
When a new view controller is pushed onto the navigation stack, there is standard support for a back button with the title of the previous view controller. This button "points" to the left rather than having a rounded rectanglar shape.
Is there a standard way to create a UIBarButtonItem that "points" to the right? This button would be used as the rightBarButtonItem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Three20 库,您可以轻松完成此操作,而无需自己创建图像(并且它将根据需要正确调整大小)在您的文本上):
此屏幕截图来自 Three20 附带的示例应用程序。
Using the Three20 library you can do it easily without creating an image yourself (and it will size up correctly depending on your text):
This screenshot comes from the example application that comes with Three20.
您可以使用与 iPhone UI 小部件一起浮动的 PNG 文件之一(示例)。将左指按钮在 Photoshop 或其他图像编辑工具中水平翻转,使其指向右侧。
然后将
UIButton
插入到rightBarButtonItem
视图中,使用水平翻转的小部件作为其图像属性。You could use one of the PNG files floating around with iPhone UI widgets (example). Take the left-pointing button and flip it horizontally in Photoshop or another image editing tool to make it point right-wards.
Then insert a
UIButton
into therightBarButtonItem
view, using the horizontally-flipped widget as its image property.