iOS UI elements are invisible - ios

I work on a project for few days. All worked great until today. I've added few elements to view just like normal today. But when I launch app on device I can't see them. They are there: size classes works ok, everything is on right place. I can even touch UISegmentedControl and pick item on UIPickerView that makes the Picker View noise. But they are invisible - I can see only older elements.
I can't even tell where is the problem, because new elemts have THE SAME setting as olders. Methods like [_someElement setHidden:NO] does nothing.
Can you help me please?
Edit: they are visible in IB Preview

probably bug with cache, try to:
-delete all data from DerivedData folder
/Users/%user name%/Library/Developer/Xcode/DerivedData
-manually remove application from device/simulator
rebuild application

Thank you, I solved it after few hours, when I was focusing on another problem.
AVFoundatuon preview layer hide those elements. Simple solution is to bring them to the top as subviews.
Thank you.

Related

Keyboard low resolution

I have an iPad project that i've been wanting to add an iPhone part to it.
So I've added a target and added a new Storyboard, but when I run the app and pressing a textfield, the keyboard looks strange. As if the resolution is low.
The left one is how it looks and the right one is how I want it to look:
Anyone has any clue? Thanks
Special thanks to James.P (from the comments above) for a great solution.
Apparently, this happens when one doesn't use any LaunchImages at all.
Just make sure to use LaunchImages correctly and it should be solved.

Storyboard corruption on file open

I am having a problem where my content is repeatedly being shifted to the right in the storyboard for multiple view controllers when I open the project. I have done nothing at this point, simply opened it. Further, undoing the modifications through git does nothing. I fix the problems and go about my day adding new features... the apps run fine in the phone and appear normal in the storyboard. However, when I open the project the next day, same thing happens and I have to fix everything again. Has anyone else experienced this issue, and what was your resolution to the problem?
I figured out what the problem was. On my first View Controller, I had some labels that had somehow become set to a width of zero. After I fixed them, and embedded them in a stack, the problem resolved itself. I have no idea how this screwed up several other view controllers; however, fingers crossed, the corruption hasn't happened again since I fixed it.
Well apparently there is just some display bug in Xcode. When I click on a new size class and click back, the elements are restored to their correct size. This was maddening, but apparently it's working fine now if I do this quick fix.

iphone simulator only shows the background images not the labels and text box, why is this?

This is a simple iOS mobile app exercise. I have a image as a background, and then the labels and text box are added. I run the simulator and it shows correctly. but after a while I run the simulator again, the simulator only shows the background image, the text box and labels are not there anymore. I restart writing everything many time and the same thing happen at some point. This is driving me crazy. Did anyone know what is going on here??? Thank you so much in advance for your help!!!
if you done with story board than your object must be in right order.
Right/Proper Way
Wrong Way
I supposed you drag all button, label,text box objects in the storyboard. All the thing are supposed to disappear if you do not used any Layout stuff. Please try AutoLayout.
Or if you write the code to show your label in viewDidLoad(), please add the objects to your subview as self.view.addSubview(yourObjects).

Xcode 6: label won't drag

Im just picking up ios development, and Im having a stupidly basic problem with xcode...
I open up a new app and open main.storyboard, and drag in a label to the center of the panel:
It just sticks to the right side, and no matter how many times I click on the darned thing, it won't move! I closed the project and started a new one, and that one worked just fine, but the problem keeps appearing just about every other time I open a new project. why does this keep happening?
That is a strange problem. You say that if you close the project and start it again, it fixes itself but keeps reappearing.
Few suggestions, try clearing up some ram by closing other, unused apps.
If that does not work, I would say delete Xcode, restart your mac, and start over. Maybe something went wrong during the install.
Storyboards are scrollable and when you scrolled out your views, you cannot make any changes to the views. Try scrolling into the storyboard and then retry moving the label.
It's AutoLayout, which is the highly recommended default for laying out components now. You need to create constraints to
position it, using the icons below the layout area.
Some components I've found I need to manipulate via the size inspector, before constraints are applied.
You will need to read up on Auto Layout sooner or later. It may seem like a hassle or drag at first, and a lot of people are cursing when they have to switch to the paradigm, but when you start to master it, it is very powerful. And it really is a sensible way to handle the layout across all the new screen sizes and orientations. It developed out of a need to manage that complexity to keep apps looking good.
Icons in IB where you set constraints for selected views:
Apple has good documentation for how to use Auto Layout as do many bloggers and sites. You will have to put some hours into getting used to it, but in a day or two you should start seeing good results.
(and don't blame me, I'm just the messenger)

Strange bug with resizing of UI elements in xCode 5? Video is attached

link to a video with bug
I simply created a project in xCode. Then I added any UI element to a view. Then I tried to resize this item to left and to right. No code, Interface Builder was used only.
I have checked with some types of projects for iOS and with UILabel and UIButton. The result is the same: when I try to resize the item from the left then it moves the parent view/viewcontroller instead.
Uncheck "Siblings and Ancestors" under Resizing Behavior in Xcode 5 Storyboard.
Voila! As such, resizing your UI elements will not cause your view controllers to move.
You need to uncheck the "Siblings and Ancestors" in your .xib/.storyboard file. See below screenshot of how to toggle this behavior on and off:
As has been said before, you must uncheck the "Siblings and Ancestors" option under Resizing Behavior in the Xcode 5 Storyboard.
The specific purpose of this feature is to be able to resize large groups of objects all at once. For instance, lets say that you have a Table View and you resize one of the cells. In this case, it would seem petty, since you would just have to resize the Table View Controller, but it becomes extremely handy once you have layered objects such as that.
Sorry for the somewhat duplicate answer, but you did ask for an explanation of why a feature like that would be added.
Additionally I have found out that another computer with the same version of xCode works with the same copy of project normally.
I didn't know how to solve this problem without uninstalling of xCode.
So I uninstalled it using AppCleaner and installed it again.

Resources