在AlertView中,方向不适用于UITableview

时间:2012-09-11 11:34:44

标签: iphone uiview orientation uialertview

我通过继承UIAlertView创建了Custome AlertView类 我在中添加了UITableView - (无效)制备

方法

This is Image of TableView inside UIAlertView with Potrait Orientation

This is when i Changed Orientation

任何人都可以建议我摆脱这个问题的方法...... 在此先感谢。

我这样做是为了跟踪方向变化

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

1 个答案:

答案 0 :(得分:2)

这对于控制来说是个好主意,我找到了一个准备就绪的Git存储库:https://github.com/blommegard/SBTableAlert/blob/master/SBTableAlert.m

它具有方向更改逻辑调度layout方法,方向更改为零间隔。代码在免费的MIT许可下分发,因此您可以使用它或只是采取一些有用的提示。

相关问题