XCode 4:某些按钮标题在 iOS 模拟中不可见 [英] XCode 4: some button titles not visible in iOS simulation

查看:24
本文介绍了XCode 4:某些按钮标题在 iOS 模拟中不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 Xcode 4 for iPhone 制作一个简单的计算器.这是我的第一个 iOS 应用程序.

I try to make a simple calculator using Xcode 4 for iPhone. It is my very first iOS application.

我使用了几个带有标题的按钮:1、2、...9、+、=、-...但是当我在 iOS 模拟中运行程序时,一些按钮没有显示它们的标题(即它们上面没有写任何东西).

I use several buttons with titles: 1, 2,...9, +, =, -... But when I run the program in iOS simulation, some of the buttons do not show their titles (i.e. they have nothing written on them).

没有标题的按钮有点随意:主要是屏幕底部的按钮,还有顶部的按钮.其他按钮正常显示其标题.

The buttons without the titles are somewhat random: majorly the ones at the bottom of the screen, but also one on the top. The other buttons show their titles normally.

什么鬼?

推荐答案

我在使用 iTunes U Piazza 课程的 iOS 计算器应用程序时也有同样的经历.我想它是在我移动一些按钮时开始的.我用文本编辑检查了 MainStoryboard.storyboard 文件 - 这些按钮似乎缺少高度约束 - 不清楚如何/为什么

I had the same experience while doing the iOS calculator app from the iTunes U Piazza course. I think it started when I moved some of the buttons. I checked in the MainStoryboard.storyboard file with text edit - it appears that the height constraint went missing from these buttons - not clear how/why

无论根本原因是什么,我只能通过删除有问题的按钮并在 xcode 编辑器中重新创建它们来修复它

whatever the root cause , I was able to fix it only by deleting the buttons in question and recreating them in the xcode editor

这篇关于XCode 4:某些按钮标题在 iOS 模拟中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆