3

我通过继承 UIAlertView 创建了 Custome AlertView 类,并在 -(void)prepare 中添加了 UITableView

方法

这是带有 Potrait 方向的 UIAlertView 内的 TableView 的图像

这是我改变方向的时候

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

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

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

1 回答 1

2

这是控制的好主意,我找到了一个现成的 Git 存储库:https ://github.com/blommegard/SBTableAlert/blob/master/SBTableAlert.m

具有零间隔方向变化的方向变化逻辑调度layout方法。该代码是在无副本 MIT 许可下分发的,因此您可以使用它或只是获取一些有用的提示。

于 2012-09-11T12:23:03.610 回答