How to make UWP landscape only?

I had an update to an app I've had in the Microsoft Store since last fall rejected because the display was "truncated" in portrait mode. It's actually not "truncated" just squeezed as it is intended to be used on desktop, notebooks and tablets but not phones. Someone got aggressive testing and tried running on a couple of Lumia Windows 10 phones (I didn't know those still were being sold). Is there a way of locking down landscape so it can squeeze on portrait? I can do this on Android and iOS. It seems to be a reported bug too:
https://developercommunity.visualstudio.com/content/problem/288903/xamarin-uwp-screen-orientation-lock-not-working.html

Most of my users will be using the app on desktop not a phone since they either use Android or iOS on mobile for this app.

Answers

  • BillyLiuBillyLiu Member, Xamarin Team Xamurai

    @BrianConrad

    You could set the InitialRotationPreference in your project:
    https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/appxmanifestschema/element-initialrotationpreference
    And you could set Supported rotation in Package.appxmanifest

  • BrianConradBrianConrad USMember ✭✭✭

    @BillyLiu said:
    @BrianConrad

    You could set the InitialRotationPreference in your project:
    https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/appxmanifestschema/element-initialrotationpreference
    And you could set Supported rotation in Package.appxmanifest

    Of course it's set like that and has been since the initial release. What I'm saying it's a bug as indicated in the link I provided. I think the Microsoft Store review team should ignore the problem and I replied to the report that they should try the app by turning the phone to so it displays in landscape. Perhaps on previous submissions if reviewers even tried on a phone they knew to do that. Perhaps there is a workaround until this gets fixed in Xamarin.

  • BrianConradBrianConrad USMember ✭✭✭

    Update: I communicated with the Microsoft Store review team and they did test the app in landscape. The report was a little misleading as it was hard to tell where they found the problem. A popup was cut off at the bottom on a Lumia phone so the entry could not be completed. Unfortunately on the store you only have the option of removing support for mobile instead of just Windows 10 phones. I haven't been able find a breakdown of devices where my app is installed to find if anyone at all had it on a mobile device (I did indeed test it on an 8" Windows 10 tablet). Redoing the interface was NOT an option.

Sign In or Register to comment.