简体   繁体   English

Xcode故事板更改未在设备或模拟器上显示

[英]Xcode storyboard changes not showing on device or simulator

This is driving me nuts. 这让我疯了。

My app was running normally and then I don't know what I did but any changes I now make in the storyboard/ IB/ Xibs etc are not updating when I run the app either on real device or simulator. 我的应用程序正常运行然后我不知道我做了什么,但我现在在storyboard/ IB/ Xibs等中所做的任何更改都没有在我在真实设备或模拟器上运行应用程序时更新。 For instance, I changed the textColor of UILabel but when I run the app, the old color still shows both on device or simulator. 例如,我更改了UILabeltextColor ,但是当我运行应用程序时,旧颜色仍然显示在设备或模拟器上。 I am using Xcode Version 7.3.1. 我正在使用Xcode版本7.3.1。

Please help. 请帮忙。 Thanks 谢谢

This solution had worked for me: 这个解决方案对我有用:

Just delete that storyboard in which changes are not reflecting and take new storyboard instead it will start reflecting changes. 只需删除那些没有反映变化的故事板,然后取出新的故事板,它就会开始反映变化。

Hopefully to save someone some frustration, I had this same problem and figured out that I must have accidentally hit Command+d while trying to copy something and duplicated the scene. 希望为了节省一些挫折感,我遇到了同样的问题,并且发现在尝试复制某些内容并复制场景时我必须意外地击中Command + d。 The duplicate was laid perfectly over the original so I couldn't tell I was editing the duplicate instead of the actual scene linked to my navigation controller. 副本完全放在原件上,所以我不知道我正在编辑副本而不是链接到导航控制器的实际场景。 I was so focused on the problem I didn't notice the new warning for an unreachable scene in my storyboard. 我非常专注于这个问题,我没有注意到我的故事板中一个无法访问的场景的新警告。

When you have the simulator open. 当你打开模拟器时。

  1. Click and hold down your app icon 点击并按住您的应用图标
  2. When you seen the icons shaking and "X" in their Top Left, Click to delete it 当您看到图标在其左上角摇动并显示“X”时,单击以将其删除
  3. Do the same for any other App Icons you may have showing in the Simulator Home screen 对于您在模拟器主屏幕中显示的任何其他应用程序图标,请执行相同的操作
  4. In Simulator menu at top - Click "HardWare" -- "Home" to stop icons shaking 在顶部的模拟器菜单中 - 单击“硬件” - “主页”以停止图标抖动
  5. In same menu Click "HardWare" -- "Reboot" (Wait for this to complete) 在同一菜单中单击“硬件” - “重新启动”(等待此操作完成)
  6. Quit Simulator from its menu "Quit Simulator" 退出模拟器从其菜单“退出模拟器”

(nb: when using device to run app, I would delete it from app as well) (nb:使用设备运行应用程序时,我会从应用程序中删除它)

Then Go back to Xcode 然后回到Xcode

  1. click in to menu "Product" -- "Clean" 点击进入菜单“产品” - “清洁”
  2. Quit Xcode and open up again 退出Xcode并再次打开
  3. Run Simulator on the iPhone Simulator Size you just cleaned out (above) 在你刚刚清理完的iPhone模拟器大小上运行模拟器(上图)

I've tried to simulate the issue you're having but unable to, however, when I have any issues on running my apps, the above seems to work. 我试图模拟你遇到但无法解决的问题,但是,当我在运行我的应用程序时遇到任何问题时,上面似乎都有效。

[ Sometimes Xcode can be a bit slow, so I tend to wait a few seconds to confirm it / Xcode has actioned it, as I sometimes used the keyboard too fast for it to keep up.] [有时Xcode可能有点慢,所以我倾向于等待几秒钟确认它/ Xcode已经采取行动,因为我有时候使用键盘太快而无法跟上它。]

Hope this helps! 希望这可以帮助!

当我的Main.storyboard没有保存时​​(它的文件图标在clean + build之后仍然是灰色的),我发现在我的终端中运行git add -ugit commit -m "//your comment"会改变Main.storyboard文件图标再次变黄(不是灰色)

Try removing all constraints from the changes you made and then reapply them. 尝试从您所做的更改中删除所有约束,然后重新应用它们。 That is what worked for me. 这对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么Xcode Storyboard中所做的更改未反映在Simulator / Device上? - Why are the changes made in Xcode Storyboard not getting reflected on Simulator / Device? 故事板中的 UIImageView 未显示在设备和模拟器上 - UIImageView in storyboard not showing on device and simulator 实际设备未根据Xcode 7.3.1中的iPad故事板显示更改 - Real device not showing changes as per iPad storyboard in Xcode 7.3.1 Xcode故事板显示了与模拟器不同的设计? - Xcode storyboard showing different design from simulator? Xcode 未将代码中的更改反映到模拟器和设备 - Xcode not reflecting changes in the code to the simulator and device Xcode 模拟器正确显示纹理但不显示设备 - Xcode Simulator Showing Textures Correctly But Not Device Swift XCode-情节提要中的更改未反映在iPhone模拟器中 - Swift XCode - Changes in storyboard aren't being reflected in the iPhone simulator Xcode:为什么相同的故事板设计在模拟器和设备上显示的方式有所不同? - Xcode : Why same storyboard design display differently on simulator and device? Xcode Main.storyboard不显示iOS模拟器中出现的内容 - Xcode Main.storyboard not showing what appears in the iOS simulator Xcode故事板模拟器测试 - Xcode Storyboard Simulator test
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM