iphone tabbarcontroller PNG
我已经没有地方可以查找为什么我的图像不会显示在选项卡栏控制器中。
无论我使用 Inkscape、Pixelmator 还是 Paint Shop Pro 的古董版本来创建然后导出 PNG,我都会得到一个蓝色突出显示的虚无方块或暗灰色的虚无方块。全部都是 30 x 30,但是黑底白字、白底黑字、彩色、无彩色,似乎都没有效果。
据我所知,我做得对: http://osmorphis.blogspot.com/2009/02/tab-bar-icons-part-1_4115.html
这个问题没有解决问题:添加 Tabbar 控制器图标 iPhone
这是来自 applicationDidFinishLaunching 的代码:
<// diagnostic>
UIImage *image = [UIImage imageNamed:@"outToLunch.png"];
if (!image) {
NSLog(@"AppDelegate: 404");
}
myVC.tabBarItem.image = [UIImage imageNamed: @"outToLunch.png"];>
我同样容易接受大笑或“哦,我没有”。不知道……”
谢谢!
I've run out of places to look for why my image will not display in the tab bar controller.
Whether I use Inkscape, Pixelmator, or an antique version of Paint Shop Pro to create and then export the PNG, I get a blue, highlighted square of nothingness or a dull gray square of nothingness. All are 30 x 30, but white on black, black on white, color, no color, none of it seems to have an effect.
As near as I can tell, I'm doing it right : http://osmorphis.blogspot.com/2009/02/tab-bar-icons-part-1_4115.html
And this question didn't resolve the issue: Adding Tabbar Controller Icon IPhone
Here's the code from applicationDidFinishLaunching:
<// diagnostic>
UIImage *image = [UIImage imageNamed:@"outToLunch.png"];
if (!image) {
NSLog(@"AppDelegate: 404");
}
myVC.tabBarItem.image = [UIImage imageNamed: @"outToLunch.png"];>
I'm equally receptive to a good laugh or to "Oh. I didn't know that ..."
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试另一个图像。那有用吗?
如果没有,请尝试清理您的构建(SHIFT-CMD-K,执行此操作时您的应用程序可能无法运行)。
你能把图片贴在这里吗? (http://imageshack.us/)
编辑:
我在我的应用程序中(在 appDelegate applicationDidFinishLaunching 中)为您测试了该图像,它对我来说效果很好。两者都在 Interface Builder 中设置并使用代码。
尝试在IB中设置它。如果有效,您可能错过了一些连接:)
Try another image. Does that work?
If not, try to Clean your build (SHIFT-CMD-K, your app can not be running when doing this).
Can you post the image here? (http://imageshack.us/)
EDIT:
I tested the image for you in my app (in the appDelegate applicationDidFinishLaunching), and it works fine for me. Both setting it in Interface Builder and with code.
Try setting it in IB. If that works, you may have missed a few connections :)
请检查图像透明度。根据文档这里标签栏图标的指导原则是:
Do check image transparency. According to the documentation here the guidelines for the tab bar icon are: