我有一個Xamarin便攜式項目。
我調試的Xaml頁面是完全空白的,我無法在Android和IOS頁面上看到任何組件。
Xamarin上的空白屏幕
我該如何解決這個問題?
注意:它沒有得到錯誤消息,頁面打開,我看不到任何東西。
問題發生在this error之後。當我修復它時,我調試的頁面變成空的,
雖然它們在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);
}
}
}
App.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()
{
}
}
}
爲什麼要投票? –
您不會發布任何示例代碼,也不會顯示錯誤消息,並且無需付出任何努力。我們沒有魔鏡,我們可以看到您所做的一切,因此您的部分調查和信息不僅得到了讚賞,而且如果您想要任何好的答案,也是必要的。 –
Okey我更新了我的問題。 –