iCulture forum | iPhone, iPad,  iPod touch, Apple TV en iOS

iCulture forum | iPhone, iPad, iPod touch, Apple TV en iOS (https://forum.iculture.nl/)
-   Ontwikkelen voor iOS (https://forum.iculture.nl/f133/development/f58/ontwikkelen-voor-ios/)
-   -   Landscape only-app maken (https://forum.iculture.nl/f133/development/f58/ontwikkelen-voor-ios/25356-landscape-only-app-maken.html)

JWVD 18-11-08 13:20

Landscape only-app maken
 
Hi,

In verband met een nieuwe applicatie die ik aan het maken ben, moet de app alleen in landscape mode beschikbaar zijn.
In info.plist heb ik
Code:

        <key>UIInterfaceOrientation</key>
    <string>UIInterfaceOrientationLandscapeRight</string>

toegevoegd, het splashscreen is dan landscape, alleen zodra de applicatie geladen is word hij teruggedraaid naar landscape. Hij moet dus in landscape blijven. Iemand enig idee hoe ik dat voor elkaar krijg?

nvrooij 18-11-08 14:40

Landscape mode
 
Voeg de volgende snippet toe aan je code voor je view:

Code:

- BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}

je kan ook kiezen voor Left of Right in landscape modus.

JWVD 18-11-08 16:06

Dat had ik ook al geprobeert, helaas springt hij nogsteeds terug naar landscape...

gekkepietje 18-11-08 19:37

Doet hij dit alleen in de simulator of ook op de iPhone zelf? De simulator heeft een bug waardoor je je view handmatig 90 graden moet draaien.

JWVD 19-11-08 12:26

Iemand anders heeft hem voor mij kunnen testen. Als je hem gedraaid start blijft die gedraait. Maar anders springt die terug...


Alle tijden zijn GMT +2. Het is nu 05:38.