Anand
Anand

Reputation: 1129

Orientation is not working for UITableview inside AlertView

i have created Custome AlertView Class by inheriting UIAlertView and i added UITableView in the -(void)prepare

method

This is Image of TableView inside UIAlertView with Potrait Orientation

This is when i Changed Orientation

can any one Suggest me the way to get out of this problem... Thanks in Advance.

i have done this to keep track of Orientation change

    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
    NSNotificationCenter* notifCenter = [NSNotificationCenter defaultCenter];
    [notifCenter addObserver:self
                    selector:@selector(orientationChanged)
                        name:UIDeviceOrientationDidChangeNotification
                      object:nil];

Upvotes: 3

Views: 341

Answers (1)

A-Live
A-Live

Reputation: 8944

That's a nice idea for control, I found the Git repository with a ready one: https://github.com/blommegard/SBTableAlert/blob/master/SBTableAlert.m

It has the orientation change logic scheduling layout method on orientation change with a zero interval. The code is distributed under copy-free MIT license so you can either use it or just take some useful tips.

Upvotes: 2

Related Questions