UINavigationBar 左/后图像是否缩放?

发布于 2024-08-17 15:33:15 字数 126 浏览 5 评论 0原文

尝试使用漂亮的“后退”箭头图像,就像 Apple iPod 应用程序中的那样 - 当我添加 30x30 图像时,它似乎被压扁或缩放,因为它看起来很小?

UINavigationBar 的后退项目是否可能必须是自定义视图?

Trying to use a nice 'back' arrow image, like that found in Apple's iPod app - when I add my 30x30 image it seems to squashed or scaled, as it looks tiny?

Is it possible that the UINavigationBar's back item will have to be custom view perhaps?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森罗 2024-08-24 15:33:15

以下是 Apple 视图控制器编程指南中的一段引用,您可能会发现它有帮助:

要将自定义按钮或视图分配给左侧位置,从而替换默认的后退按钮,请将 UIBarButtonItem 对象分配给 leftBarButtonItem 属性。

UIBarButtonItem 类有一个对 initWithImage 的调用,它允许您使用您选择的图像设置视图。希望这有帮助。

Here is a quote from Apple's View Controller Programming Guide which you might find helpful:

To assign a custom button or view to the left position, and thereby replace the default Back button, assign a UIBarButtonItem object to the leftBarButtonItem property.

The UIBarButtonItem class has a call to initWithImage which allows you to set the view with an image of your choosing. Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文