Wie wird der Bildschirm im Hoch- / Querformat auf dem iPhone gesperrt?
Meine Anwendung unterstützt alle Ausrichtungen, aber in einigen Fällen möchte ich den Bildschirm sperren
Hoch- / Querformat.
In meiner Bewerbung habe ich zwei Arten von PDF-Dokumenten.
Eines ist im Hochformat und das andere im Querformat.
Ich möchte ein Hochformatdokument nur in der Hochformatansicht und ein Querformatdokument in der Hochformatansicht öffnen
Nur Landschaftsansicht.
ich möchte das so machen: wenn meine anwendung in der landschaftsansicht geöffnet ist und ich auf die klicke
Hochformat-Dokument muss also in der Hochformat-Ansicht gedreht werden, und dies gilt auch für Querformat, wenn
Meine Anwendung ist im Hochformat geöffnet und wenn ich auf das Querformat klicke, dokumentiere ich es
muss rotieren oder es muss das Dokument nur im Querformat öffnen.
Ich hoffe, ich mache euch klar, entschuldigt mein Englisch. Ich hoffe, ihr versteht, was ich will, bitte
brauche deine Hilfe .
Danke im Voraus
Hier ist mein Code:
- (void)viewDidLoad
{
[super viewDidLoad];
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationPortrait || orientation ==
UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"Portrait");
if ([orientationObject isEqualToString:@"p"]) {
//If the document is portrait
pdfScrollViewFrame = CGRectMake(-0.0, -80.0, 770.0, 1085.0);
}
else{
// If the document is landscape
pdfScrollViewFrame = CGRectMake(-0.0, -40.0, 770.0, 1130.0);
}
}
else{
NSLog(@"Landscape");
if ([orientationObject isEqualToString:@"p"]) {
//If the document is portrait
pdfScrollViewFrame = CGRectMake(65.0, -80.0, 620.0, 1110.0);
}
else{
//if the document is landscape
pdfScrollViewFrame = CGRectMake(0.0, -40.0, 740.0, 1070.0);
}
}