简体   繁体   中英

I created a Xamarin UWP app, but for some reason it's blank. How can I get my Xamarin UI to appear in the UWP app?

With a Xamarin Android app, the UI doesn't need to be defined twice, once in the Xamarin project and once in the Android project; the Android project seems to be able to see the changes made to the UI in the Xamarin project and adjust itself accordingly. However when I create a UWP app with this MainPage.xaml:

<forms:WindowsPage
    x:Class="ApiPrototypeClientMobile.Uwp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ApiPrototypeClientMobile.Uwp"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:forms="using:Xamarin.Forms.Platform.UWP"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

</forms:WindowsPage>

it is blank, as if I need to redefine the UI from scratch or maybe I set something up wrong so it's not getting loaded properly. Do I actually need to redefine the entire UI for the app all over again for UWP, or did I just set it up wrong?

There is no need to do anything specific to support UWP. It may happen that some plugins don't support UWP and that may be the cause. Or that the layout is impossible as some UWP controls have padding by default unlike on other platforms. It could be various things, so you need to check piece by piece on what is blocking your UI to appear.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM