我有一个 Xamarin 便携式项目。
我调试的 Xaml 页面完全是空白的,我在 Android 和 IOS 的页面上都看不到任何组件。
我怎样才能解决这个问题?
注意:它没有收到错误消息,页面正在打开,我看不到任何内容。出现此错误
后出现问题。当我修复它时,我调试的页面变成空的,
尽管它们在 InitializeComponent 错误之前工作。
任何帮助将不胜感激。
这是我的 xaml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="AcikAkademi3.Layoutlar.GridOrnek3">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label BackgroundColor="Red" Text="0,0" Grid.Column="0" Grid.Row="0">
</Label>
<Label BackgroundColor="Blue" Text="1,0" Grid.Column="1" Grid.Row="0">
</Label>
<Label BackgroundColor="Yellow" Text="Açık Akademi" Grid.Column="2" Grid.Row="0"></Label>
<Label BackgroundColor="White" Text="0,1" Grid.Column="0" Grid.Row="1">
</Label>
<Label BackgroundColor="Silver" Text="1,1" Grid.Column="1" Grid.Row="1">
</Label>
<Label BackgroundColor="Lime" Text="2,1" Grid.Column="2" Grid.Row="1">
</Label>
</Grid>
</ContentPage>
这是我的cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace AcikAkademi3.Layoutlar
{
public partial class GridOrnek3 : ContentPage
{
public GridOrnek3()
{
Padding = new Thickness(0, 20, 0, 0);
}
}
}
应用程序.cs:
using AcikAkademi3.Layoutlar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xamarin.Forms;
namespace AcikAkademi3
{
public class App : Application
{
public App()
{
MainPage = new GridOrnek3();
}
protected override void OnStart()
{
}
protected override void OnSleep()
{
}
protected override void OnResume()
{
}
}
}