Nickolay Kabash
Nickolay Kabash

Reputation: 239

UWP App has weird layout on Windows Phone

I got a simple app on UW. When I build and deploy it on PC it looks like this: PC

But when I change the build target to ARM and deploy it on my phone (Lumia 550), the app gets a weird layout: black rectangles on the top and a black rectangle instead of the list view. How can I fix this?

Mobile

Code:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="auto"/>
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <SplitView>
        <SplitView.Pane>
            <ListBox>
            </ListBox>
        </SplitView.Pane>
        <SplitView.Content>
            <Frame Name="mainFrame" />
        </SplitView.Content>
    </SplitView>
</Grid>

mainFrame contains:

<Grid>
    <ListView/>
</Grid>

There is no Properties on Grid in both Xaml

Upvotes: 2

Views: 235

Answers (1)

James Croft
James Croft

Reputation: 1680

At first glance, this looks like an issue with the OS theming and the way you've set the foreground in XAML.

Windows Phone has support for a true light and dark theme. If your phone is set to use the dark theme, all default backgrounds will be black. If you've manually set the foreground of your text to black, you're going to see something similar to this with black on black text. The way I came to this conclusion is that your search box is using it's dark styling in the phone version.

If you're intending on the app always having a white background, I recommend using the RequestedTheme="Light" at the root of your page and unless you're changing the color's of text, not setting a value for the foreground as this allows the theme in the OS to handle it for you.

Do you have some XAML so that we can establish this is the issue?

Upvotes: 1

Related Questions