UIView의 하위 클래스에 하위 뷰가 있습니다. 장치가 회전하면 하위 뷰를 제거합니다. 이것은 내 코드입니다UIDevice의 beginGeneratingDeviceOrientationNotifications가 제대로 작동하지 않습니다.
- (void)awakeFromNib
{
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged) name:UIDeviceOrientationDidChangeNotification object:nil];
}
- (void)orientationChanged
{
[subview removeFromSuperview];
}
내 문제는 장치가 약간 기울어 지거나 하위보기가 제거되는 테이블을 올려 놓는 경우에도 마찬가지입니다. 이것을 막기 위해 무엇을 할 수 있습니까?
앱이 여러 인터페이스 방향을 지원합니까? –
그렇습니다 ... –