通过Xamarin.Forms和Uno平台从WebAssembly中的按钮进行不可预知的样式更改
我正在开发一个跨平台的Xamarin.Forms应用程序。现在,我通过Uno平台添加了对WebAssembly的实验性支持 在Uno平台中,WebAssembly UI依赖于UWP UI。正如您在底部看到的,我的内容页面上有一个按钮,它响应大小的变化,并且不会错过当前的建议: 但是,在WebAssembly中,按钮的文本向右移动,如您所见: ScrollView和StackLayout中的我的特殊ContentView项目组合如下:通过Xamarin.Forms和Uno平台从WebAssembly中的按钮进行不可预知的样式更改,xamarin,xamarin.forms,uwp,uwp-xaml,uno-platform,Xamarin,Xamarin.forms,Uwp,Uwp Xaml,Uno Platform,我正在开发一个跨平台的Xamarin.Forms应用程序。现在,我通过Uno平台添加了对WebAssembly的实验性支持 在Uno平台中,WebAssembly UI依赖于UWP UI。正如您在底部看到的,我的内容页面上有一个按钮,它响应大小的变化,并且不会错过当前的建议: 但是,在WebAssembly中,按钮的文本向右移动,如您所见: ScrollView和StackLayout中的我的特殊ContentView项目组合如下: <Grid x:Name
<Grid x:Name="ResultGrid" Grid.Row="1">
<StackLayout>
<ScrollView x:Name="Scroller" >
<StackLayout x:Name="DataStack" Margin="30" />
<!-- Contentview added inside DataStack via code . -->
</ScrollView>
</StackLayout>
</Grid>
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="ACM_SearchEngine_xFormsWASM.UserControls.SearchResultCapsule" >
<ContentView.Content>
<Grid x:Name="ResultDataViewer" Margin="0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Frame BackgroundColor="#4CB8C282" BorderColor="#343434" CornerRadius="10" Grid.RowSpan="2" Grid.ColumnSpan="3"></Frame>
<Image x:Name="FileLogo" Margin="10" Source="Assets\journalcover_small.png" Grid.RowSpan="2" Grid.ColumnSpan="1" WidthRequest="96" HeightRequest="96" />
<Button x:Name="Buy_Button" Text="Satın Al" FontAttributes="Bold" TextColor="#e2e2e2" BackgroundColor="#2A52BE" FontFamily="Segoe UI" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1" CornerRadius="5" VerticalOptions="Start" HorizontalOptions="Center" FontSize="15.667" Grid.Row="0" Margin="0,10,10,0" WidthRequest="100" />
<Label x:Name="Issue_TitleMonthYear_Label" FontSize="18.667" FontAttributes="Bold" FontFamily="Segoe UI Bold" Grid.Column="1" Grid.ColumnSpan="1" Grid.RowSpan="1" Margin="10"></Label>
<Label x:Name="IssueNumber_Label" Text="1" FontSize="18.667" FontAttributes="Bold" FontFamily="Segoe UI Bold" Grid.RowSpan="2" Grid.ColumnSpan="1" VerticalOptions="Center" HorizontalOptions="Center" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" Margin="0,8,0,0" ></Label>
<Label x:Name="ArticlesList_Label" TextType="Html" Margin="10" Grid.Column="1" Grid.ColumnSpan="1" Grid.Row="1" Grid.RowSpan="1" FontSize="15.667" TextColor="#36454F" FontFamily="Segoe UI Bold" FontAttributes="Italic" />
</Grid>
</ContentView.Content>
</ContentView>
private void ContentPage_Appearing(object sender, EventArgs e)
{
SearchKeyword_Title.Text = string.Format("'{0}' anahtar kelimesi arama sonuçları:", search_keyword);
var z = new SearchCapsule_IssueCreator(32, SearchCapsule_IssueCreator.Months.Eylül.ToString(), SearchCapsule_IssueCreator.Months.Ekim.ToString(), 2020, "");
var t = new SearchCapsule_IssueCreator(21, SearchCapsule_IssueCreator.Months.Nisan.ToString(), SearchCapsule_IssueCreator.Months.Mayıs.ToString(), 2020, "");
z.AddArticle("XAML - HTML dönüşümü nasıl yapılır ?", 15, 20);
z.AddArticle("Bu bir test yazısıdır.", 45, 60);
t.AddArticle("UNO Platform Hakkında.", 3, 10);
t.AddArticle("Deneme 1-2-3.", 22, 30);
var x = new SearchResultCapsule(z);
var y = new SearchResultCapsule(t);
DataStack.Children.Add(x);
DataStack.Children.Add(y);
}
我如何预防这个问题?谢谢。您使用的是哪个版本?软件包版本:Id版本Uno.Xamarin.Forms.Platform{4.3.4}Uno.Wasm.Bootstrap{1.0.10}Microsoft.Extensions.Logging.Filter{1.1.1}Microsoft.Extensions.Logging.Console{1.1.1.1}NETStandard.Library{2.0.3}Xamarin.Essentials{1.3.1.1}NETStandard.Library{2.0.3}Xamarin.863}Microsoft.NETCore.UniversalWindows{6.1.9}Xamarin.Essentials{1.3.1}