[英]iPhone Navigation Bar button, using custom image, done with Interface Builder
iPhone application, which has two buttons -right side- of Navigation Bar title. iPhone应用程序,它有两个按钮-导航栏标题的右侧。 I want to do this completely using Interface Builder and have had some limited success.
我想完全使用Interface Builder做到这一点,并且取得了一些有限的成功。 The current problem is with buttons using custom image.
当前的问题是使用自定义图像的按钮。 All built-in images are ok, eg Info Light or Add Contact.
所有内置图像都可以,例如“信息灯”或“添加联系人”。 Custom image just won't get visible.
自定义图像将不可见。
Type: custom 类型:自定义
Title: (empty) 标题:(空)
Image: (empty) 图片:(空)
Background: my_image.png 背景:my_image.png
Any ideas what to try? 有什么想法可以尝试吗? Could it be that my PNG image is somehow wrong?
可能是我的PNG图片有问题吗? Tried also images, which show ok on Tab bar.
还尝试了图像,这些图像在选项卡栏上显示确定。 Please note that button highligh works ok.
请注意,按钮highligh可以正常工作。 Just missing the image... Must be close, right?
只是缺少图像...必须靠近吧?
EDIT: I read your question a bit too quickly the first time. 编辑:我第一次读你的问题太快了。 I now see you're using a custom view for the UIBarButtonItem.
现在,我看到您正在使用UIBarButtonItem的自定义视图。 Are you just simulating this through Interface Builder, or have you tried building your project and running it in the Simulator or on your device?
您只是通过Interface Builder进行仿真,还是尝试构建项目并在Simulator或设备上运行它? I was able to successfully get a custom image in view in a UIBarButtonItem, though I had to build and run my project before I could see it (simulating it through IB wasn't enough).
我能够在UIBarButtonItem中成功地获得视图中的自定义图像,尽管我必须先构建并运行项目才能看到它(通过IB模拟它是不够的)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.