简体   繁体   English

iPhone导航栏按钮,使用自定义图像,由Interface Builder完成

[英]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.

相关问题 iPhone 6的自定义导航栏图像 - Custom navigation bar image with iphone 6 在iPhone导航栏上绘制自定义后退按钮 - Draw custom Back button on iPhone Navigation Bar 带按钮的iPhone自定义导航栏未单击 - iPhone custom navigation bar with button doesnt click Interface Builder(iPhone开发人员)自定义按钮背景图像不符合拉伸设置 - Interface Builder (iPhone dev) custom button background Image does not respect Stretching settings iPhone Interface Builder 中的自定义控件 - Custom Control in iPhone Interface Builder 在不使用 uinavigationcontroller 的情况下将“完成”按钮添加到导航栏 - add “done” button to navigation bar without using uinavigationcontroller 使用Mono Touch的Iphone键盘顶部带有完成按钮的工具栏? - Tool bar with done button on top of keyboard for Iphone using Mono Touch? 如何在不使用界面构建器的情况下处理iPhone中的按钮onclick动作? - how to handle button onclick action in iPhone without using interface builder? 如何在iphone中将在导航栏中创建的按钮设置为自定义? - How to set the button created in the navigation bar as custom in iphone? 使用 Interface Builder 将 UIToolBar 按钮的大小调整为自定义图像的大小 - Adjusting the Size of a UIToolBar Button to the Size of a Custom Image with Interface Builder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM