UITableView disappears when switching from portrait to landscape - iphone

hey there, I am creating an app that requires me to add tables in a particular page. The page should
be in landscape mode but the application in portrait. I've figured out the switching i.e from portrait
to landscape and back to portrait [homepage(portrait) -> tablePage (landscape)] and vice versa. The problem is the table view keeps reducing in size i.e the first time I am able to see the whole table, but when I go back to the home page and come back to the tablePage I just see half the table, it's like as if the table view gets cut off. Again I go back to the homepage and come back to the table page I don't see the table at all, i.e the whole table disappears. Please help.

I had the same problem. Everything works fine in iOS 4.3 simulator, but one single UITableview disappeared in iOS 5 in landscape mode. I solved this by simply dropping another UIView on my view and moved the UITableView into that.
Looks like a bug in iOS 5 to me. Let's hope, Apple will fix it soon.

Related

Auto-rotation stopped working on iOS 7 XCode 5

In interface builder, I selected, copied, and pasted a textField, switch, button, and label from my iPhone Storyboard's Flipside view controller into the iPad Storyboard's popup view controller.
After that I started getting weird errors on those exact items, about frames that "will be different at runtime" that would not go away, and they did not have disclosure triangles to tell me what to do to fix it. I tried removing all my constraints to fix it, and that didn't fix it. Later I imply deleted those items which had been pasted into the iPad Storyboard and the errors went away.
But now auto-rotation does not work in my app. The status bar (time & battery indicator) rotates but nothing else does. Except sometimes it does, but when it does, it gets stuck in the landscape orientation and won't rotate back properly.
At one point also I did set the main view controller from "Intrinsic" to "Landscape" just to see how it would look in Landscape mode, but later I changed it back.
I feel like my XIB files must have gotten corrupted somehow... how can I fix this? I've tried deleting all my constraints and re-adding them, both manually and by the recommended method. Setting the thing back to Portrait and then Intrinsic and cleaning my build folder. Updating to the latest Xcode Beta (which claims to have enhancements for auto-layout and constraints, which has always seemed buggy to me, with the constraints menu somtimes refusing to pop up, etc.). But still rotation just doesn't work.
What do I do? Thanks.
The problem was caused by the fact that I was loading a UIAlert when the app launched. You could dismiss the alert but then the auto-rotation was broken. Once I got rid of the UIAlert everything was fine.
Weird.

Xib Size - seems to think its longer than it is

This is a bit of a strange one, but basically I am having a problem whereby the xib size of my initial view controller seems to be longer than the screen.
So, if you have an ad banner set to be on the bottom of the screen... If I run the app in simulator, it does not show on iPhone 3GS/4/4S devices, yet WILL show on the iPhone 5.
I have tried changing the xib size settings, I even created a new xib file, but the same problem is occuring which leads me to believe it is hardcoded somewhere, but I cannot think where to look for this.
It is basically like it thinks the bottom of the screen is about 30-50px more than what it actually is... Hence why the iPhone5 displays ok as it has the taller screen.
Any help would be appreciated!
Its bcoz of the StatusBar. It reserve 20px of screen . You can remove this space by do change in Status bar is initially hidden in plist and set status bar to NONE in IB.
The iPhone 5 has a taller screen. The most flexible way to lay out your xib is via AutoLayout. Here is a tutorial to get you started:
http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
http://www.raywenderlich.com/20897/beginning-auto-layout-part-2-of-2
Basically, you want the ad banner to be contrained to the bottom of the view.

Disabling bounces in uitableview also disables scrolling on iOS 5 but not iOS4

I have an app with a table view in a nav controller; I wanted to disable bouncing so that when my table is in Edit mode, user can scroll down and find rows to delete; otherwise, it would bounce back and not give them the opportunity to press the delete icon next to the row.
So I did this:
self.tableView.bounces=NO;
When I run my app on iOS 4, this works like a charm. User can scroll and the table does not bounce back.
But on iOS 5, the scrolling is also not working at all for the table. No scroll. So to be safe, I did this:
self.tableView.bounces=NO;
self.tableView.scrollEnabled=YES;
But this made no difference.
I create my table view and its nav controller programmatically; everything else is working fine with them. Any idea why disabling bounces would also prevent scrolling on iOS 5?
I found the solution here:
UITableView won't scroll after editing view frame and origin
If you manually set the origin of the tableview, on iOS 5 it disables scrolling. on iOS 4 it is not. a shame, really.

UITableView has problems scrolling after upgrading to iOS5

I just noticed now that I've updated my app to iOS 5, that when my tableview has fewer cells than fit the screen, it doesn't scroll, but if I click a cell to go to detail view, and then pop back to the table, it scrolls fine. Also, if I initially have more cells than fit on the screen, it scrolls fine from the start.
Any ideas?
Take a look at the Nib for the VC. XCode 4.2 has made some changes to IB and the way tables are dealt with, so that's probably where you issue lies.
Hope that helps.

iPhone MapView gets removed

I have a tabBar in my application. In one of the section i have two views which i toggle between using segment buttons.
In one of the view i have MapView which i use to display list of users using their pic as annotation. On the other view i have tableView which shows the same users in table format.
Now everything is working fine, i am getting all the users and it displays fine on the map. It works perfectly most of the time on all device and all iOS but sometimes when i bring the mapView to front or toggle or try to zoom in. Both the views (tableView and mapView) just gets removed somehow and i see black screen (which is btw my superview so thats not a problem).
Does anyone know why this happens. It happens frequently on iPhone 3G the older iPhone.
Thanx for any help.
I've had the same problem. I think it's due to low memory to which your app responds by deallocating the tableView and mapView. My solution was to have both views allocated in viewDidLoad. I'm not 100% sure about this, but you could give it a try.