I am new to windows phone application development. I am developing application for windows 8.0. I cannot find file [Package.appxmanifest] in the project.
Is there a setting in application that turns on orientation? Because when I rotate my phone my controls stay same in potrait mode.
Can any one guide me please?
Package.appxmanifest is a WP8.1 runtime thing. For WP 8.0, it's AppManifest and WMAppManifest. You can find it under Properties under the project Solution.
As for orientation, click your MainPage.xaml and select your <phone:PhoneApplicationPage> tag. Under Common, you can change your Orientations.
And here's a Quick Start Guide in handling Orientation Changes: Quickstart: Screen orientation for Windows Phone 8
In your designer page there will be a property named SupportedOrientations. You can change that to Portrait, Landscape or PortraitOrLandscape for both.
While developing if you want to change the orientation use Orientation property.
<phone:PhoneApplicationPage
x:Class="TemplateSwitcher.MainPage"
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"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
Related
I have created an app in Windows 8.1 and running it on Windows 10 tablet, but I want to run the app in landscape mode only.
How can I restrict the user from switching to tablet mode from the action center?
but i want to run app in landscape mode only
You can add InitialRotationPreference in your package manifest:
<InitialRotationPreference>
<Rotation Preference="landscape"/>
</InitialRotationPreference>
This will keep your app displaying in landscape and will not change the orientation when device is held in Portrait or Portraitflipped.
Foe more details, see InitialRotationPreference.
need to restrict user to switch tablet mode from action center.
Check the last FAQ in the documentation:
screen rotation is not necessarily related to tablet mode. Screen rotation is tied to your current device configuration which may or may not map to whether the device is in “tablet mode”.
Updated:
The ConvertibleSlateModePromptPreference is for OEMs. There does not exist a WinRT API to realize this currently.
I've noticed that all guidelines, guides and blogs explain that the standard margin on the left (leading) for Windows Phone is 12.
Yet, when I go "File > New Project in VS2013" for any type of Windows Phone app, I'm met with a margin of 19, which looks really good.
<!-- Title Panel -->
<StackPanel Grid.Row="0" Margin="19,0,0,0">
<TextBlock x:Uid="Header" Text="application name" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,12,0,0" />
<TextBlock Text="{Binding Title}" Style="{ThemeResource HeaderTextBlockStyle}" Margin="0,-6.5,0,26.5" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}"/>
</StackPanel>
It looks good, as in the bar at the top with the signal indication, aligns perfectly with 19 in the simulator, yet in designer view it aligns with the number 12 instead.
Why is this? I keep editing my every XAML to match Margin="19,0,0,0" when I thought they should all be Margin="12,0,12,0". Is that right?
It's the difference between Windows Phone Silverlight and Windows Phone Runtime app scaling. Silverlight apps always scale to 480 virtual pixels wide. Runtime apps scale based on pixel density at specific plateaus (multiples of 20% for Windows Phone 8.1 and of 25% for Windows 10).
The 12 pixel guidelines you saw were for probably for Silverlight apps on Windows 8.
That said, the scaling documentation for Windows 10 appears to contradict itself and says 12 pixels for narrow modes in Responsive design 101 for Universal Windows Platform (UWP) apps and 20 pixels in Guidelines for resizing to narrow layouts. I'll file a doc bug to synchronize these.
I'm encountering strange behavior on a Windows Phone 8.1 project. The culprit is the FontStyle="Italic" property of a TextBox control.
I created a new Windows Phone 8.1 project, on the MainPage.xaml page I have this XAML:
<Grid>
<TextBox Text="Am I mad?"
FontStyle="Italic"/>
</Grid>
On the designer, the text shows in italic:
But when I run the project in the emulator, the italics are gone:
I also saw that when I modify the XAML by adding FontWeight="Bold" to the TextBox like so:
<TextBox Text="Am I mad?"
FontStyle="Italic"
FontWeight="Bold"/>
both the bold font weight and the italics show up and work as expected. Am I missing something obvious?
So i updated to the newest flash version and started using Air for ios 3.4. That's great, now i can properly auto orient the screen and always keep it in landscape easily. BUT for some reason the app is just one fourth of the screen and is in the upper left corner with the rest of the screen being white.
Here is an image of the problem: [http://i.imgur.com/i4ZSt39.jpg][1]
Before, with air 3.2 the size was right and i have no idea what caused this with air 3.4. All the grapichs are 1024*768
Any help will be deeply appreciated
I believe 3.3 or 3.4 is the version that fixed support for retina displays. Prior to that, all AIR versions reported the retina iPads as non-retina.
You should make sure that <requestedDisplayResolution>high</requestedDisplayResolution> is found in your app.xml in the iOS Additions section.
Additionally, you need to make sure that you are not using static values for your app's sizing. Non-Retina iPads are 1024x768 (the resolution your app is using, I believe), but Retina iPads are 2048x1536. Your positioning and sizing should be completely fluid and responsive and never rely on fixed sizes. Instead of setting a Sprite's width to 1024 to fill the entire screen, you should instead use stage.stageWidth, for example.
Word to the wise, though: if you want to submit to the App Store, you're going to need at least the most recent release of AIR 4.0. iOS 7 requires new icon sizes that weren't added until 3.8 or 3.9 and all apps are now required to be compiled using XCode 5, something that AIR 4.0 added support for. For the record, we are currently on AIR 13.0 (after 4.0, version numbering system was changed to a rapid release system and bumped to 13.0 to make it match Flash Player)
How to configure the windows phone to be fixed to only landscape mode, I there any possibility to do it with C# so that I should be able to get the consistent behaviour across the application
You can get it via C#
this.SupportedOrientations = SupportedPageOrientation.Landscape
You should set the SupportedOrientations property of all pages to Landscape:
<UserControl x:Class="MyWindowsPhone.Page"
... other attributes omitted
SupportedOrientations="Landscape">
<!-- controls go here -->
</UserControl>