Activa las notificaciones push PhoneGap Spain

Foro

Home Forums PhoneGap No permitir que rote la pantalla cuando gire el telefono en mi aplicación.

This topic contains 2 replies, has 2 voices, and was last updated by  ReyBruno 6 dias, 7 horas .

Viendo 3 respuestas - de la 1 a 3 (de 3 en total)
  • No permitir que rote la pantalla cuando gire el telefono en mi aplicación.

    Intervenciones
  • ReyBruno 
    Participant

    Hola, este es mi primer post en el foro, estoy aprendiendo lo básico de desarrollo de apps con phonegapp. Quería saber si existe alguna forma de hacer que, una vez dentro de la aplicación, no se pueda rotar la pantalla del telefono. Es decir, que la app se vea siempre de manera vertical.

    Mi config.xml es este:

     Code: confix.xml (select
    1.
    2.
    3.
    4.
    5.
    6.
    7.
    8.
    9.
    10.
    11.
    12.
    13.
    14.
    15.
    16.
    17.
    18.
    19.
    20.
    21.
    22.
    23.
    24.
    25.
    26.
    27.
    28.
    29.
    30.
    31.
    32.
    33.
    34.
    35.
    36.
    37.
    38.
    39.
    40.
    41.
    42.
    43.
    44.
    45.
    46.
    47.
    48.
    49.
    50.
    51.
    52.
    53.
    54.
    55.
    56.
    57.
    58.
    59.
    60.
    61.
    62.
    63.
    64.
    65.
    66.
    67.
    68.
    69.
    70.
    71.
    72.
    73.
    74.
    75.
    76.
    77.
    78.
    79.
    80.
    81.
    82.
    83.
    84.
    85.
    86.
    87.
    88.
    89.
    90.
    91.
    92.
    93.
    94.
    95.
    96.
    97.
    98.
    99.
    100.
    101.
    102.
    103.
    104.
    105.
    106.
    107.
    108.
    109.
    110.
    111.
    112.
    113.
    114.
    115.
    116.
    117.
    118.
    119.
    120.
    121.
    122.
    123.
    124.
    125.
    126.
    127.
    128.
    129.
    130.
    131.
    132.

    <?xml version="1.0" encoding="UTF-8" ?>

    <widget
      xmlns   = "http://www.w3.org/ns/widgets"
        xmlns:gap   = "http://phonegap.com/ns/1.0"
        id          = "com.phonegap.ahoraquehago"
        versionCode = "10"
        version     = "1.0.0" >

    <name> Ahora que hago </name>

    <description> Guia interactiva de primeros auxilios  </description>

    <author email="lucasreyb@hotmail.com" href="phonegap.com"> Lucas Rey Bruno </author>

    <content src="index.html" />


    <!--
    Paste this into your config.xml for correct access to the images generated by http://pgicons.abiro.com/.
    -->
    <!--
    Active tags hint at what the tool generates by default.
    -->
    <platform name="ios">
    <icon src="res/icons/ios/icon-1024.png" width="1024" height="1024"/>
    <icon src="res/icons/ios/icon-small.png" width="29" height="29"/>
    <icon src="res/icons/ios/icon-small@2x.png" width="58" height="58"/>
    <icon src="res/icons/ios/icon-small@3x.png" width="87" height="87"/>
    <icon src="res/icons/ios/icon-small-40.png" width="40" height="40"/>
    <icon src="res/icons/ios/icon-small-40@2x.png" width="80" height="80"/>
    <icon src="res/icons/ios/icon-small-40@3x.png" width="120" height="120"/>
    <icon src="res/icons/ios/icon-small-50.png" width="50" height="50"/>
    <icon src="res/icons/ios/icon-small-50@2x.png" width="100" height="100"/>
    <icon src="res/icons/ios/icon.png" width="57" height="57"/>
    <icon src="res/icons/ios/icon@2x.png" width="114" height="114"/>
    <icon src="res/icons/ios/icon-60.png" width="60" height="60"/>
    <icon src="res/icons/ios/icon-60@2x.png" width="120" height="120"/>
    <icon src="res/icons/ios/icon-60@3x.png" width="180" height="180"/>
    <icon src="res/icons/ios/icon-72.png" width="72" height="72"/>
    <icon src="res/icons/ios/icon-72@2x.png" width="144" height="144"/>
    <icon src="res/icons/ios/icon-76.png" width="76" height="76"/>
    <icon src="res/icons/ios/icon-76@2x.png" width="152" height="152"/>
    <icon src="res/icons/ios/icon-167.png" width="167" height="167"/>
    <icon src="res/icons/ios/icon-83.5@2x.png" width="167" height="167"/>
    <!--  Legacy portrait  -->
    <!--  <splash src="res/screens/ios/Default~iphone.png" width="320" height="480"/>
    <splash src="res/screens/ios/Default@2x~iphone.png" width="640" height="960"/>
    <splash src="res/screens/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
    <splash src="res/screens/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
    <splash src="res/screens/ios/Default-568h@2x~iphone.png" width="640" height="1136"/>
    <splash src="res/screens/ios/Default-667h.png" width="750" height="1334"/>
    <splash src="res/screens/ios/Default-736h.png" width="1242" height="2208"/> -->
    <!--  Legacy landscape  -->
    <!--

            <splash src="res/screens/ios/Default-Landscape~ipad.png" width="1024" height="768"/>
            <splash src="res/screens/ios/Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
            
    -->
    <!--  Storyboard portrait  -->
    <!--

            <splash src="res/screens/ios/Default@2x~iphone~anyany.png" />
            <splash src="res/screens/ios/Default@2x~iphone~comany.png" />
            <splash src="res/screens/ios/Default@3x~iphone~anyany.png" />
            <splash src="res/screens/ios/Default@3x~iphone~comany.png" />
            <splash src="res/screens/ios/Default@2x~ipad~anyany.png" />
            <splash src="res/screens/ios/Default@2x~ipad~comany.png" />
            
    -->
    <!--  Storyboard landscape  -->
    <!--

            <splash src="res/screens/ios/Default@2x~iphone~comcom.png" />
            <splash src="res/screens/ios/Default@3x~iphone~anycom.png" />
            
    -->
    </platform>
    <platform name="android">
    <icon density="ldpi" src="res/icons/android/ldpi.png"/>
    <icon density="mdpi" src="res/icons/android/mdpi.png"/>
    <icon density="hdpi" src="res/icons/android/hdpi.png"/>
    <icon density="xhdpi" src="res/icons/android/xhdpi.png"/>
    <icon density="xxhdpi" src="res/icons/android/xxhdpi.png"/>
    <icon density="xxxhdpi" src="res/icons/android/xxxhdpi.png"/>


    <!--  Portrait  -->


    <!--  <splash density="port-ldpi" src="res/screens/android/splash-port-ldpi.png"/>
    <splash density="port-mdpi" src="res/screens/android/splash-port-mdpi.png"/>
    <splash density="port-hdpi" src="res/screens/android/splash-port-hdpi.png"/>
    <splash density="port-xhdpi" src="res/screens/android/splash-port-xhdpi.png"/>
    <splash density="port-xxhdpi" src="res/screens/android/splash-port-xxhdpi.png"/>
    <splash density="port-xxxhdpi" src="res/screens/android/splash-port-xxxhdpi.png"/> -->


    <!--  Landscape  -->
    <!--

            <splash density="land-ldpi" src="res/screens/android/splash-land-ldpi.png" />
            <splash density="land-mdpi" src="res/screens/android/splash-land-mdpi.png" />
            <splash density="land-hdpi" src="res/screens/android/splash-land-hdpi.png" />
            <splash density="land-xhdpi" src="res/screens/android/splash-land-xhdpi.png" />
            <splash density="land-xxhdpi" src="res/screens/android/splash-land-xxhdpi.png" />
            <splash density="land-xxxhdpi" src="res/screens/android/splash-land-xxxhdpi.png" />
            
    -->
    </platform>


        <platform name="windows">
            <icon src="res/icons/windows/storelogo.png" target="StoreLogo" />
            <icon src="res/icons/windows/smalllogo.png" target="Square30x30Logo" />
            <icon src="res/icons/windows/Square44x44Logo.png" target="Square44x44Logo" />
            <icon src="res/icons/windows/Square70x70Logo.png" target="Square70x70Logo" />
            <icon src="res/icons/windows/Square71x71Logo.png" target="Square71x71Logo" />
            <icon src="res/icons/windows/Square150x150Logo.png" target="Square150x150Logo" />
            <icon src="res/icons/windows/Square310x310Logo.png" target="Square310x310Logo" />

             <!-- <splash src="res/screens/windows/splashscreen.png" target="SplashScreen"/>
            <splash src="res/screens/windows/splashscreenphone.png" target="SplashScreenPhone"/> -->
        
        </platform>
        




    </widget>


    Daniel Riera
    Daniel Riera 
    Participant

    Hola ReyBruno, la opción que estás buscando es esta, añade esto a tu config.xml y la app siempre se verá de manera vertical

    1.  <preference name="Orientation" value="portrait" />

    Si es para iOS comprueba en xCode que solo está seleccionada la opción portrait

    Saludos


    ReyBruno 
    Participant

    Muchisimas gracias Daniel! Me funcionó de maravilla :-D


Viendo 3 respuestas - de la 1 a 3 (de 3 en total)

You must be logged in to reply to this topic.