XCode Storyboard is empty and changes not visible on it - ios

I have a serious problem on XCode. I can not see my storyboards correctly even they are full of elements. Sometimes elements are visible after I restart the XCode but later it happens again. Another issue is that even I change fonts or change locations of elements its not visible on storyboard until I restart the XCode.
XCode version is: 8.2.1 (8C1002)
You can see in the image that storyboard is transparent.

Related

Issue in loading StoryBoard [duplicate]

I have updated by Xcode to Xcode 11 Beta and have updated the build settings from iOS 12.2 to iOS 13. Everything is working perfectly but the viewcontrollers in Storyboard appear black. The components of the viewcontrollers are present but it is difficult to preview due to the black screens
Had this same issue, eventually tracked it down by cut-pasting elements from the black screen to a brand new view controller and see which ones cause the new one to have the same error, or caused the old one to render.
After fixing it, the diff ended up being a background image on a specific UIButton.
I found that after updating to Xcode 11 if one element has an issue, it breaks the whole storyboard like your screenshot.
I had this issue last night. My UITableView was expanding too far out of the screen on the right hand side. I dragged it back into the bounds of the UIViewController parent and updated the right hand side constraint to be 0.
So check if anything goes beyond the UIViewController boundary that shouldn't.
In Xcode 12.4
After trying lots of thing, finally i resolved my issue
First close your project.
just goto finder -> Application -> Xcode -> get info -> uncheck open using Rosetta
Now, simply open your project.
Just delete any constrain in that viewcontroller and then undo the change.
Check the values for the cell heights. In opening an older project, the row height (in the TableView itself) was 0. Changing it to a positive value or deleting the value (so it defaults to automatic) fixed the issue for me.
I had the same issue, here are the steps I followed.
Clear constraints, for my case the source was from UITableView, and make sure constraints are attached to safearea not superview.
From the toolbar on the top, go to Editor > Canvas > Layout Rectangle. It is very important to repeat this step 3 times.
Once finished, quit XCode and reopen it again and everything should be fixed. I've noticed this happens when I'm switching views for different devices 8, 11, 4s.
I don't know exactly what the problem was, but I was able to solve it with the following steps.
Run 'pod install' to install all cocoapods dependencies
In Xcode: Product -> Clean Build Folder
Restart Xcode and run the project

Xcode 12.4 storyboard can not change background color of a View

I'm a newbie in IOS development and I made a new Iphone app. Try to change in storyboard the background color of a View but can not. I changed it in Inspector pane in Background and Tint block but anyway the colour is black. Even if I change the light mode to light or dark. And therefore the elements are invisible. What I already tried:
Deleted a View, create e new one. Deleted a project and created a new one.
Preferences > Locations > Derived Data > click the arrow to open in Finder > trash it.
But It did not help me. Can you explain me please how to do it.
My problem was because I work on a new Macbook M1. And usually I deal with React Native projects, therefore I launched XCode only with rosetta 2, because the current versions of RN projects is not building there. After usual launch with out rosetta 2 the error and black background has disappeared.

Xcode's XIB and Storyboard's UIElements are not visible

I am using Xcode 11.5, sometime UIElements on XIB or Storyboard file are not visible. Only blue placeholder rectangles are visible. If clean the project, delete derived data, quit and reopen the project it works but sometime not. I faced same issue in older Xcode version also. Any solution?

Xcode 11 Beta - Storyboard ViewControllers Appears Black

I have updated by Xcode to Xcode 11 Beta and have updated the build settings from iOS 12.2 to iOS 13. Everything is working perfectly but the viewcontrollers in Storyboard appear black. The components of the viewcontrollers are present but it is difficult to preview due to the black screens
Had this same issue, eventually tracked it down by cut-pasting elements from the black screen to a brand new view controller and see which ones cause the new one to have the same error, or caused the old one to render.
After fixing it, the diff ended up being a background image on a specific UIButton.
I found that after updating to Xcode 11 if one element has an issue, it breaks the whole storyboard like your screenshot.
I had this issue last night. My UITableView was expanding too far out of the screen on the right hand side. I dragged it back into the bounds of the UIViewController parent and updated the right hand side constraint to be 0.
So check if anything goes beyond the UIViewController boundary that shouldn't.
In Xcode 12.4
After trying lots of thing, finally i resolved my issue
First close your project.
just goto finder -> Application -> Xcode -> get info -> uncheck open using Rosetta
Now, simply open your project.
Just delete any constrain in that viewcontroller and then undo the change.
Check the values for the cell heights. In opening an older project, the row height (in the TableView itself) was 0. Changing it to a positive value or deleting the value (so it defaults to automatic) fixed the issue for me.
I had the same issue, here are the steps I followed.
Clear constraints, for my case the source was from UITableView, and make sure constraints are attached to safearea not superview.
From the toolbar on the top, go to Editor > Canvas > Layout Rectangle. It is very important to repeat this step 3 times.
Once finished, quit XCode and reopen it again and everything should be fixed. I've noticed this happens when I'm switching views for different devices 8, 11, 4s.
I don't know exactly what the problem was, but I was able to solve it with the following steps.
Run 'pod install' to install all cocoapods dependencies
In Xcode: Product -> Clean Build Folder
Restart Xcode and run the project

IBDesignable drawings not displaying in storyboard

I am having an issue with IBDesignable elements not appearing in the storyboard view. It seems to be particular to my machine/version of Xcode (2015 11" Macbook Air running MacOS 10.14.4 and Xcode 10.2.1) and not an error in the code, as the same project displays fine when run on a 13" Retina (Xcode 9.2). It also displays correctly in the simulator.
I have tried cleaning and rebuilding the project, creating a new project, restarting Xcode, restarting the computer, deleting derived data, and updating to the latest version of Xcode but have had no success.
When I attempt to run Editor > Debug Selected Views, I get the following error: "Could not attach to pid: #### Error 1."
Below is an image showing my IBDesignable class and the resulting storyboard presentation.
Any help with this would be greatly appreciated!
UPDATE:
I also noticed that when I select the designable view, the inspector reads "Designables Updating," as in the image below:
This finally solved my problem:
https://stackoverflow.com/a/26720740/5291486
To sum up, I enabled Editor > Automatically Refresh Views and then clicked Editor > Refresh All Views.
Verify if the code in your draw function is correct.

Resources