Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

App Orientation
Started by thatssopanda Nov 19 2014 06:55 PM

10 replies to this topic
landscape portrait orientation
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

thatssopanda

[GLOBAL: userInfoPane.html]
thatssopanda
  • Contributor

  • 124 posts
  • Corona SDK

Hello!

 

I'm having troubles with getting Windows 8 to recognize Landscape mode instead of Portrait mode. Following the steps outlined here - http://docs.coronalabs.com/daily/coronacards/wp8/portapp.html - I set the properties panel to be Landscape. Here's the relevant code in MainPage.xaml:

Foreground="{StaticResource PhoneForegroundBrush}" Orientation="LandscapeRight"
    shell:SystemTray.IsVisible="False" TabIndex="2147483645" SupportedOrientations="Landscape">

Is there another setting I should be making for my app to be in Landscape?



[TOPIC: post.html]
#2

thatssopanda

[GLOBAL: userInfoPane.html]
thatssopanda
  • Contributor

  • 124 posts
  • Corona SDK

[TOPIC: post.html]
#3

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

I just tested this out and it worked for me.  Are you sure you are editing the attributes belonging to the <phone:PhoneApplicationPage> tag?



[TOPIC: post.html]
#4

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Also, when you are in Visual Studio's UI designer for your "MainPage.xaml", the phone displayed in the UI designer should appear landscape too.  That would confirm that the landscape settings that you applied to the XAML took hold.  If your page still appears portrait in the UI designer, then there is something wrong in your XML.



[TOPIC: post.html]
#5

thatssopanda

[GLOBAL: userInfoPane.html]
thatssopanda
  • Contributor

  • 124 posts
  • Corona SDK

Hello!

 

In visual studio, the app shows side ways, but it doesn't show sideways on device. Here's my MainPage.xml:

<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:corona="clr-namespace:CoronaLabs.Corona.WinRT.Phone;assembly=CoronaLabs.Corona.Controls.DotNet"
    x:Class="Alphabet_Jigsaw.MainPage"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}" Orientation="LandscapeRight"
    shell:SystemTray.IsVisible="False" TabIndex="2147483645" SupportedOrientations="Landscape">

    <DrawingSurfaceBackgroundGrid x:Name="fDrawingSurfaceBackgroundGrid">
        <corona:CoronaPanel x:Name="fCoronaPanel"/>
    </DrawingSurfaceBackgroundGrid>

</phone:PhoneApplicationPage>



[TOPIC: post.html]
#6

thatssopanda

[GLOBAL: userInfoPane.html]
thatssopanda
  • Contributor

  • 124 posts
  • Corona SDK

Also, here is a screenshot of my visual studio. Visual studio is showing my app in landscape mode, but not showing in landscape when testing on device.

 

https://drive.google.com/file/d/0Byz-bwuX-tobb1QwOTJqT0djZ1U/view?usp=sharing



[TOPIC: post.html]
#7

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

I don't see anything wrong in your XML.  What does your "MainPage.xaml.cs" file look like?

Did you code anything in C# that forces the orientation to portrait in your MainPage class' constructor?

 

Also, try doing a rebuild of your project by clicking the "BUILD\Rebuild Solution" menu item in Visual Studio.

Other than that, I'm running out of ideas.  Changing those 2 orientation attributes in your xaml should be all that you need to do.



[TOPIC: post.html]
#8

thatssopanda

[GLOBAL: userInfoPane.html]
thatssopanda
  • Contributor

  • 124 posts
  • Corona SDK

Hello! I've resolved the issue! I uninstalled the app completely from my Windows device and reinstalled to get landscape mode to work.

 

To any future developers reading this post and to summarize, I had issues with my app showing in portrait mode when I set it to landscape. If you've tested the app on your device, you may need to completely uninstall the app from your windows phone and then reinstall to see the changes. This worked for me.

 

Thanks for the assistance Joshua!



[TOPIC: post.html]
#9

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Hmm... it sounds like Visual Studio was not overwriting your app when deploying it to the WP8 device.  Good idea about uninstalling the app.  Might be good advice next time someone has a similar issue.  I mean, changing the orientation of your app was supposed to be easy.  :)



[TOPIC: post.html]
#10

thatssopanda

[GLOBAL: userInfoPane.html]
thatssopanda
  • Contributor

  • 124 posts
  • Corona SDK

Off subject: Joshua, while I have you attention, should I be building for ARM or x86 when building for store?



[TOPIC: post.html]
#11

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

You have to build for "Release|ARM".

The reason is because all WP8 devices use ARM CPUs.

 

x86 builds are only for testing your app in the WP8 emulator.




[topic_controls]
[/topic_controls]