xCode - Why can't I see this object on the view? - objective-c

This might be a silly question, but why in the world can't I see the the following button that I simply dragged and dropped to the view from the interface builder?
I am using Simulator iPhone Retina (3.5 inch) / iOS 7. When I try to scroll to the bottom, the scrolling ends and I cannot see the button that I placed at the bottom. Why is that? Thanks.
EDIT: I didn't do anything fancy. I simply created a new single view app, and then dragged the button to the bottom of the view on storyboard and then clicked run.

Storyboard simulate size of 4 inch display. When you run it on 3.5 inch display, content at the bottom of the screen will be clipped.
Just add constraints to attach button to bottom of the screen.

Related

UIBarButtonItems are randomly resizing in bottom UIToolBar

I added a UIToolbar on the bottom a view controller in IB.
I added a few UIBarButtonItems, but it seems to randomly resize either when I click on one of the UIBarButtons or if I leave the view and come back to it.
Is there any reason why it is doing this? I didn't have this issue when I was running iOS6, but on iOS7, xCode 5 the words shrink and expand randomly.
Is there anyway to lock the size or fix this issue?
Thanks!

How do I fix empty 44px space in iOS7 view with ViewDeckController?

I am in the process of transitioning an app to iOS7. All of the views throughout the app have a 44px empty space at the bottom that appears to be for a bottom toolbar or something, but I am not trying to display a bottom toolbar. This space also exists on views that do have a bottom toolbar and the toolbar just shows directly above it.
The red space shown is actually a view behind the black view. No matter what size I set the frame of the black view to, the red space is always shown. I am also hiding the status bar in plist, so don't know if this is an artifact from that or if it has something to do with navigation bar as they are both normally 44px in height.
I have looked at the transitioning guide and haven't found anything that's worked. Any ideas to what could be causing this and how to fix?
UPDATE:
I have tried setting edgesForExtendedLayout = UIRectEdgeAll and extendedLayoutIncludesOpaqueBars = YES (also tried NO) with no effect. When I look at the subviews of the navigation controller it shows a UIToolBar as hidden, but shows it contains a frame in the exact area the view refuses to resize to even with autolayout constraints.
UPDATE 2:
This is actually a problem with ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets it's center view bounds.
I believe it has to do with the UINavigationBar. Try toggling the following options in Storyboard and see if it solves the problem. Namely, the 'Extend Edges' options:
These options can also be set in code with the edgesForExtendedLayout and extendedLayoutIncludesOpaqueBars properties on UIViewController.
If you are transitioning to iOS 7, you should be using an Auto Layout constraint to anchor to the Bottom Layout guide. Control drag from your view to the Bottom Layout guide and choose Vertical Space from the popup menu.
Using frames in iOS 7 is harder and is the way of the past.
Auto Layout is hard to grasp at first, but it is very powerful once you get the feel.
This is actually a problem with third party library ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets centerViewBounds for IIViewDeckControllerIntegrated. I was able to figure it out after changing to IIViewDeckControllerContained and seeing the view sized correctly.
In IIViewDeckController.m, just return self.referenceBounds for iOS7 like it does for IIViewDeckControllerContained.

xcode adding button to uitabbarcontroller is not clickable on landscape

I am adding a simple button into a view on a tabbarcontroller to the bottom right of the view. This button is clickable only when it is on portrait, not when the app is flipped to landscape. The app is using autolayout, so I've added two constraints so it hugs the bottom right of the view on landscape and portrait. Horizontal space at 20 and Vertical space at 24. I've tried this on a UIViewController without the UITabBarController, and it works perfectly. But once the view is added to a tab, it stops working. How do I get this button clickable on both portrait and landscape?
This seems like a very simple setup, but I have no idea why this does not work.
![snapshot2]http://ownits-stackoverflow.s3.amazonaws.com/snapshot2.png
![snapshot3]http://ownits-stackoverflow.s3.amazonaws.com/snapshot3.png
I tried the same thing it works. Here is the sample code try to run it on your own simulator and on device.
Sample Project

iPhone 5 retina 4 inch touch screen

I'm adapting my app to iphone 5 and I've got a problem. I saw all documentation regarding this and it didn't work yet.
I put the Default-568h#2x.png and everything resized successfully.
The problem is in the touch stuff. I've got a toolbar on the bottom and when I touch it nothing happens :( in the retina 4" simulator. Works fine in retina 3.5
In retina 4", if I set the toolbar in the inspector above 439 px in the Y position works fine. Anything below this makes my toolbar not to work.
As I said, I tried many many things unsuccessfully.
I'm using Xcode 4.6.1, I've got a Main View (not having a Window option in the Attributes inspector).
Thanks in advance.
Your window or the main view is not resizing correctly. Make sure you have set them up such that they autoresize in both directions. Try to set different background colors to your views to find the view that is not resizing correctly.
Ensure that all of your views are auto-resizing correctly to fill the screen. It sounds like the main container view you have isn't being resized and is drawing the toolbar outside of its frame. This will work from a visual point of view as UIView - clipsToBounds defaults to NO, but touches won't work outside the frame.

Tableview not using all available space

I have an IOS application containing, amongst other view controllers, a view controller with a UIScrollView and UITableView. This is launched with
self.storyboard instantiateViewControllerWithIdentifier.
I hope this maybe something simple, but I cannot get the table view to use all its available space, i.e. the UITableView has enough height for say 4 rows, but it starts to make use of scroll bar when there is only 3 rows in the table.
Regarding the scrollview, I have some horizontal content which is only 25 in height, but if I make the UIScrollView anything less than 110 in height or so, then the horizontal content will only appear partially on screen or not at all.
Xcode 4.4.1 on OSX Lion, IOS 5.1
Any help will be appreciated.
Fixed the problem myself (Trying to find a host to put some screenshots. Will update).
I set the Bottom Bar from Inferred to Tab Bar in the Attribute Inspector and it now works. Both the previously unusable spaces in the ScrollBar and the TableView can now be used. These space were both of the size of the Tab bar. Took a while to work this out, as even before this change, the tab bar was showing on the simulator, so I didn't think it was Tab Bar related.