Fadia Jaradat
Fadia Jaradat

Reputation: 199

TableView in landscape mode in objective c

I am developing an iPhone app and there is a table in the landscape view where I added a text field so as the user will input data, on iPhone 4, the user can click on all cells and columns and enter the text, BUT on iPhone 5, the table is NOT clickable in the first 2 columns (landscape view)! Any idea how why and how to make the first 2 columns clickable? enter image description here Plz see attachment . Many thanks in advance

Upvotes: 1

Views: 296

Answers (2)

Nikolai Ruhe
Nikolai Ruhe

Reputation: 81878

While views can draw outside of their superview's bounds they cannot receive touch events.

You have to make sure that you table view and all its superviews cover the whole area of the screen. It looks like one of the superviews is rotated but not resized correctly. Check this by typing ...

po [myTableView.window recursiveDescription]

... in the debugger, for example at a breakpoint in your controller's viewDidAppear.

It's probably a good idea to switch to proper UIViewController, rootViewController, etc. usage instead of doing the rotation in your custom code. Your app will behave much more as expected.

Upvotes: 0

Manimaran
Manimaran

Reputation: 577

Do this for change the orientation!!

-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
    {
        return UIInterfaceOrientationLandscapeLeft;
    }
}

Upvotes: 2

Related Questions