UIBarButtonItem 背景的 Alpha 不能设置为零

发布于 2024-12-27 09:23:44 字数 373 浏览 1 评论 0原文

我有一个想法,使用我自己的图像作为 BarButton 项目。我做了以下操作:

  1. 将 UIView 添加到 Interface Builder 中的 UIToolbar。 View 自动转换为包含 UIView 的 UIBarButtonItem。

  2. 将 UIImageView 添加到 UIView

  3. 将 UIView 的 Alpha 设置为零

但是,我无法对 UIBarButtonView 上的 alpha 执行任何操作,并且无法获取摆脱背景。

由于 UIBarButtonItem 不是基于视图的,因此使用 UIToolbar 的开箱即用功能似乎无法完成任何操作。或者?

I have an idea to use my own images as BarButton items. I did following:

  1. Added UIView to UIToolbar in Interface Builder.
    View was automatically converted to UIBarButtonItem with UIView contained.

  2. Added UIImageView to UIView

  3. Set Alpha of the UIView to zero

However, I cannot do anything with alpha on UIBarButtonView and I cannot get rid of background.

Since UIBarButtonItem is not View based, there seems nothing can be done here with out-of-the-box functionality of UIToolbar. Or?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文