How to change view size in IB for iPhone 3.0 - iphone

I want to change the view size for iPhone 3.0, but I find that in IB, size&Position section, the Width and Height for view was set as fixed values. Does apple forbid us to change its value here. How can I change its Height then?
PS:I use the navigation bar as title bar, so I need to change the height of view to 416 so as to know how much space I can use to organize my controls.

If you're just looking to see how much room you have with a navigation bar, you can use IB to simulate a navigation bar without actually changing the size of a view. In IB, select the view, then open the Attributes Inspector (Command-1). In there, find the section titled "Simulated User Interface Elements", and change the value for "Top Bar" to "Navigation Bar".

Related

Temporary extra space on top of UICollectionView w/ navigation bar

There are a couple of things wrong with my UICollectionView and corresponding cells that are under a navigation bar. First of all, when the view first loads, there seems to be some extra space on the top. But when I do a little scroll down (not a full scroll), it adjusts to normal height. Check out the images below for what I mean. this is what I see when i first open the view controller
after a little scroll, not a full one (There are 10 cells in this VC), i see this. Why is this happening?
In your viewcontroller uncheck Adjust Scroll View Insets
Go to your storyboard in your view controller select your collectionView and from the side pane select size inspector there is an option of content insets set it to Never.

UITableView has blank space below, can't remove

I have a UITableView that displays some data that is read in at runtime and features a button below it that will refresh the list when clicked. All of that works fine, however there is a problem with the layout on the simulator.
When I run, there is a space at the bottom of the table that pushes the refresh button down. No matter how long the UITableView is, the UIButton will always be kept at that extended distance. If I overlay the bottom with the UIButton, it does display with slightly less padding. I am at a loss of how to fix this.
Image with example of behaviour: http://img864.imageshack.us/img864/9913/screenshot20120326at113.png
I think the problem is that in the interface builder your layout does not show at the same size, because it lacks the navigation bar at the top.
In the visual editor, choose the window hosting your table view, go to the attribute inspector, and choose Navigation bar for the Top Bar entry in the Simulated Metrics section of the inspector. The layout of your design will change. Resize your table view, move your button, rebuild the app, and run it again; this should do the trick.
It looks like it's because you're designing without the navigation bar simulated and you've set up your autoresizing masks incorrectly.
What you can do is either enable the simulated metric (attributes inspector in IB with the main view selected) for the top bar set to Navigation Bar, or you can go and fix your autoresizing masks. They are the red things in the size inspector in IB.
It is because when you designed the screen you didn't consider the navigation bar that is gonna come. Simply add a bar to the screen on the top and rearrange the table and button with proper autoresizing masks. It will fit.

UIStepper does not move up when Navigation Bar dissapears

I am writing a IPhone App. In it there is a search bar (UISearchBar with Controller). When I select it, it gets focussed, and the navigation bar disappears, and the body gets darkened so that when I type on search bar the suggestions (search results) appear. My problem is when I select the search bar, before I type anything, I can see my original view through a tinted black body area. There I see all of my other controls (buttons, textfields) moved up (because navigation bar disappeared), but the UISteppers have not moved, which makes them misaligned.
Why is this ?
It may depend on how you have the relative alignment setup. In your Storyboard, use the Inspector (the ruler icon on the right hand side options) and see if you have set the others to be relative.
I believe this is a bug. I have noticed the same exact behavior in several apps I have worked on (both iPad and iPhone) Storyboard based apps. I have re-produced this behavior on apps with only one orientation. To re-produce, simply layout a scene and add UI elements of different types with at least one UIStepper. Then add the scene to a Nav Controller and all the UI elements will move EXCEPT for any UISteppers.

iphone popup custom size in IB

In my application I need show some info popup. This is just a text message above an image. When I create UIView for my popup in IB, it's size is non-ediatable (and equals to 320x460).
But my popup is not full-screen size.
Of course, I can create this popup programmatically, but I'd prefer data-driven approach.
So, the question is: how do I create custom-size UIView in IB?
If you set status bar of the view to none then you should be able to resize the view.
When a view is at the root level in an interface builder document it will always appear to be 320x460 but the size isn't actually set. Interface builder is just simulating what it will look like when it's actually loaded.
If this Popup view is actually supposed to appear in another existing view then drag it inside that view in IB. Once it's no longer at the root level you will be able to set its size.

UISegmentedControl not expanding size for navigation bar/very squished

Running through an iPhone SDK book and one of the examples has me creating a table and then later adding a UISegmentedControl to the table for sorting.
I dutifully did this in IB, and it looks great:
IB Screenshot http://img.skitch.com/20100529-83sefni21q4nj51rw1mghh2yj1.jpg
When I run it in the simulator or my phone, it's totally squished:
Squished http://img.skitch.com/20100529-x3pmr7gkb6xpm766bupi7quy55.jpg
The buttons work perfectly, it's just they are not sizing according to their content. Any ideas what's going wrong?
Here's the attributes I have set:
Attributes http://img.skitch.com/20100529-tp4d69bk8x98c6sjpmcne92etb.jpg
You could try explicitly setting the width of each of the segmented control's components. Click the Size tab at the top of the inspector and set the width for each component.
I experienced the same issue once. The problem was that the UINavigationController's view was not the top-level view in the hierarchy (it was not added to UIWindow directly), but it was added as a subview to another view controller's view instead. It's just a guess, maybe that's your problem, too (or that there are more than one visible view controllers).
OK, so in attempting to implement #Chris Gummer's answer, I seem to have learned more about how the Size->View Size property panel works. The default is:
Default Sizing http://img.skitch.com/20100529-gg9dwq5em3557yb1d6d721hpn4.jpg
and this is not a good default, it would seem. My book didn't mention needing to adjust this, so I didn't look at it. Setting the inner horizontal arrow of the box (which I guess means "fit width to available space") did the trick:
The Answer http://img.skitch.com/20100529-xt1bqghb4kbm2pbcqf1i1uygab.jpg