Interface Builder doesn't let me "SCROLL DOWN" - iphone

I have a UITabelView as my interface. My height is bigger than 460 pixels. I cannot edit any of my Table View Cells (or anything) below the bottom of the simulated APP at 460px I do not want to "programmatically add things in the interface." How do I "SCROLL" in interface builder??
I am using Xcode 4.2 and using STORYBOARDS as well!!
Thank you so much!!!!

Set your view's y axis (-ve). Like if you have table view 600px which mean you have 160px non visible by default. For editing it make your view or table view to y axis = -160. You will get your view visible. But don't forget make it 0 again and height to 460 for running your app well.
I think this is what you was looking for. Let me know in case of else thing.

Related

Layout for an ios app

I have some issues when i launch my swift application on ipad simulator. I have a home view witch displays 5 images. In my storyboard i have set for all of those constraints for height, width and also spacing. The problem is that when my app is running from ipad , the photo on the middle is situated over the other ones and the spacing is not as i expected.
What i want is a way i can make the same space value between images for each screen size and that the images will resize themselves in order to respect the initial view. Any piece of advice is more than welcome !^.^
Remove width and height constraints for your image views and add equal width and equal height constraints to them. Check out "Auto Layout Tutorial" section "Fixing the width" to see how to set equal width between views. I recommend you to read it whole :)
Nikita is right.
I can add: often apps evolve, so you will add another image.. far better to pass to a CollectionView where every CollectionViewCell owns an image.
In this way:
1) you can decide layout very precisely (with constraints in InterfaceBuilder, or form code using NSCollectionViewFlowLayout delegate methods..)
2) You can manage rotation easily
3) You can scale for iPhone..

Layout differencies in Interface Builder and real device screen

I' m developing an application for both Retina 3.5 and Retina 4 screens (iPhone family). And I encountered with the next problem. I create a view in .xib file and set size to Retina 3.5 full screen.At the very bottom of the screen I placed a view with UILabel. You can see the view on the screen:
As you can see the view is at the very bottom. But when I run the application either on device or the simulator view with label on some reason doesn't fit the screen:
So the question - what can be the problem? How can I fix this? Why IB view sizes is not correct?
You've set your NIB to not have a status bar, but your app does have one. This means your NIB is sized at 480 pts high (on a 3.5" screen), when it should in fact be 460 (due to the status bar). This pushes your view down by the corresponding height (20 pts, which you can see at your cut-off label at the bottom).
There are a number of fixes for this. You could just tell your NIB it has a status bar, but a better option would be to set your view to resize dynamically according to its bounds. Exactly how you do this will depend on whether you're using auto-layout or not, but you'll want to check 'autoresize subviews' and make sure your view elements stay locked where you want them to.

iPhone 4 & 5 Autoresize Vertical Space

I built my views in Interface Builder for iPhone 4 dimensions. I thought that the Autoresize Constraints in iOS 6 will take care of the resizing automatically. The screenshot shows the Top Space constraint that Xcode added automatically. It says that the relationship between the top and the bottom orange view must be 332 points.
When viewed in iPhone 5, the orange button is stretched all the way to the bottom as you can see in the screenshot below.
When changing the relation to Greater Than or Equal, the view does not change and remains the same. When removing the constant to make it Auto, the view is stretched across the entire screen. How do I specify a constraint were the height is 44 points and at the bottom?
Don't have a constraint to the top of the superview. Pin it to the bottom of the superview, and fix the height to 44, then delete the constraint linking it to the top of the view.
You achieve the pinning by selecting the view in question and using the pinning menu in interface builder (the floating menu with three icons on it, or editor-->pin from the menu bar).
To move between 3.5 and 4 inch displays, you need to link content to the correct edge of the superview. Stuff at the bottom should be stuck to the bottom.
I have written about constraint editing in interface builder here if you're interested.
Try adding your own contraints (user constraint), In Auto Layout for each object there must always be enough constraints to determine both its position and size on different devices screen.
Interface Builder automatically creates constraints for you as soon as you place a view in a layout. Try placing your views along IB’s automatic guides to help it guess correctly which layout you want.
Prior to Xcode 4 it was done by setting the springs and struts from the Interface Builder and the springs and struts model is still the default, so for every programmatically created view that you want to use autolayout with, dont forget to call
setTranslatesAutoresizingMaskIntoConstraints:NO.

Can't see UIScrollView content under 480px in Interface Builder

I have all my buttons / labels / texts embedded in a uiscrollview. Everything works fine. However, how do I see / edit beneath the 480px mark in IB? It cuts off the uiscrollview at the bottom. I am using storyboarding in xcode 4.2 ios5.
Just in case you haven't yet found the answer and to save an answer. The solution is simple, but hard to find an answer on the web. Try this:
Select the Scroll View object
Select the Size Inspector (option-cmd-4)
Under View -> Y, enter a negative number (acts as scroll up)
Make sure View -> Height is large enough for the contents of your scroll view
Add, position and configure subview
(Optional) Set the View -> Y back to 0 for building
Before:
After setting the Y value:

how do i work on a taller view in interface builder?

OK, so I am learning to use UIScrollView in interface builder. since the scrollView itself does not have any content, I created another view, the contentView, to hold my controls and scrollable content. into this view I place controls, labels, etc and then in my code i set the contentSize of the scrollView to the size of this contentView.
My question seems stunningly simple and so obvious that I must have missed something somewhere. when I created this XIB in IB I got your standard empty iPhone interface window. I dropped a scrollView on top of it, it took up the whole window. I dropped a view on top of that, it took up the whole scrollview. I added some controls, which so far I can still see inside the contentView rectangle in IB.
My question is how do I work on/add controls which lie outside of the visible part of the contentView in IB? LOL. it seems so simple, but i just don't get it. I can set the height of the content view or drag the rectangle to whatever I like (and indeed this is the whole point of having a scrollview) but the fixed UI window from IB won't expand so i can see the "offscreen" part of the contentView to add more controls. It's like it's just fixed at that size because that's the size of one iPhone screen and it won't let me make it any bigger/taller.
what did I do wrong?
-a
You need to turn off all simulated user interface elements (like the status bar) to be "undefined" except for size, which you select to be "Freeform" from the drop-down, and then you can set the view height using the Ruler tab to be whatever you like.
For example, here I've selected a photo view controller, and set the size in the right side bar to be "iPad Full Screen" - but I could also change that to "freeform" to set any height I wished.
First add a ViewController by any which way you prefer. Then in interface builder, click on the view controller Icon (on left). In the connections inspector click on the ruler icon "Show the size inspector". There will be option list for simulated size, change to "Freeform" and increase the height to any size you want. Hope this helps.
neeever mind. you drag the content view up so that some controls are offscreen and then add more controls/expand to the part you just made visible by moving the top stuff off the top. in effect, you physically scroll the contentView in IB by dragging it with the mouse. seems a smidge counterintuitive, but whatever.
Set simulated size to freeform for the the view controller to a large enough size that you can add in your controls
You don't have to create a view to place inside the scrollview if you don't want. In your case, it sounds like it doesn't make much sense.
As for the second part of your question, you can place items directly on the scrollview (it is a view afterall), as subviews. If you want them to be off screen, then just set their frame up to be at those particular x, y coordinates you want it to be at. You will have to ensure your scrollview's contentSize property is large enough though to house your entire content, this is what allows scrolling horizontally/vertically.
You probably want to do the offscreen elements programmaticly instead of using xibs.