UI built using xib is messed up - ios

I created a UI for landscape view of my application. It is perfectly designed, all is aligned well in my xib. However, when I run my application in simulator, everything is out of order in the design. Everything is not in it's default position in xib. How can I fix this?

Related

IOS DEV: Should I be concerned if the Main.storyboard layout looks different from the actual layout?

So for my app, the tableview layout in the iOS simulator when I click run is CORRECT and as I intend. However the layout is not always 100% the same when I view the layout of the tableview in Main.storyboard. When I refresh Xcode(i.e. quit and restart app), the layout of Main.storyboard is what I intend. However, if I play around with orientations/diff iOS devices within Main.storyboard, and then return to my original device, the layout looks incorrect (even though supposedly the math/measurements are correct). Do I need to be concerned?
For reference I followed the instructions of https://www.ralfebert.de/ios-examples/uikit/uitableviewcontroller/custom-cells/ EXACTLY to make a cell (instead of an image, I used a button though). And here is an image of my iPad simulator https://drive.google.com/file/d/152scJF6h12amh-AAycDqpe6TXOzN2y-H/view?usp=sharing vs the main.storyboard simulator https://drive.google.com/file/d/1NvUfMVLk08S8qH4mFraRsQYbDzPdjaBG/view?usp=sharing
However the layout is not always 100% the same when I view the layout of the tableview in Main.storyboard.
It sounds like you might have some missing or incorrect constraints. Take a look at the little yellow arrow icon to the right of "View Controller Scene":
That icon tells you that there are some issues that you need to resolve. Click it and you'll get a list of the particular issues and your options for fixing them.
Do I need to be concerned?
The risk, of course, is that under some circumstances your view won't draw the way you want it to. Start by fixing the issues that Xcode is pointing out, and then test on lots of different devices (or simulators) as you can, in all the possible geometries you might encounter (different screen sizes, orientations, split view, etc.).

porting iPad app to iPhone using one storyboard with one storyboard

i am able to make my iPad app running on iPhone but the iPhone screens doesnt fit all the content in. For example my table view main text is hidden, the buttons are very much spaced from the border. I understand the spacing given in my storyboard files in too big for iPhone screen.
I want to make my app work for iPhone with very minimal changes. I dont want to create a new storyboard and rewrite everything. Please suggest a good way.
Thanks in advance.
You need to make the app Universal, make a single storyboard the main storyboard in both target's project settings and use Autolayout to position your UI elements respective of the device. Look into Size classes to keep your design responsive.

All of my objects disappear in my iOS simulator, why is that?

I'm currently working with one navigation controller, and 3 view controllers. when i run my program, everything runs smooth, but none of my objects on my second and third view controller appear in the simulator ( labels, buttons, text fields etc.), how ever the navigation bar is there. why is that? how do i fix it?
For me, the issue was that I had added the button to the LaunchScreen.storyboard, instead of the Main.storyboard.
Credit to this post: http://discourse.djp3.net/t/first-ios-app-button-and-label-disappear-in-simulator/104/13?u=drazisil
Apparently it was an auto layout error. I removed auto layout and disabled size classes from my project and the simulator showed every object within the interface. I then enabled both auto layout and size classes once again & manually added my constraints instead of allowing Xcode to do it for me. Worked out fine once i ran the simulator again. I think this is a bug in Xcode's iOS sim.

UIButton size appears as DEFAULT at runtime despite being resized in XIB

I have a iPhone app I am converting to Universal. I properly set up the MainWindow-iPad.xib and tied its view controller to my view controller class and all the other links etc and at run time, under the iPad simulator the App WORKS Perfectly...
However, I have 2 buttons in the XIB for iPad, and while in the XIB they are both resized from the default size to the sizes I want, and appear properly, at runtime under IPAD they appear as though the are still the default size when added to the XIB.
All other things done to the buttons appear proper, images, text, backgrounds etc are all working perfectly fine, but for some reason on the IPAD and IPAD Emulator only they are ignoring the size the XIB says they should be.
Does anyone have any idea what is going on? I have double and triple checked all the settings for the buttons in the XIB editor to ensure there is nothing different between the IPAD and IPHONE xib files related to these UIButtons, but they still appear at runtime with the wrong size.
Okay, DOH! moment... had an explicit XIB load in the code... so it was always loading the default MainWindow.xib no matter what...

UI in Interface Builder doesn't match UI on a device

I am totally new to iOS development. Just starting working in Xcode 4. I build UI using IB, but when running it on simulator or an actual device UI is rendered differently (I get overlapping buttons on the device or simulator, although everything is displayed correctly in IB). None of the controls were created with code. Everything was done in IB. I copied some buttons in IB as they are performing the same logic and hooked up to the same IBAction. I checked view hierarchy - everything looks right.
Any idea what might be causing it?
Thanks.
Take a look to the option of your xib's simulated metrics.Check attached screen shot.

Resources