Xamarin.forms 在何处设置xamarin表单母版页样式
我是一个新手,正在阅读一本关于Xamarin.forms 在何处设置xamarin表单母版页样式,xamarin.forms,Xamarin.forms,我是一个新手,正在阅读一本关于Xamarinforms(xaml)的书,其中一个例子是ContentPage和ListView: <ListView ItemsSource="{Binding ListItems}" RowHeight="100" BackgroundColor="Black" HasUnevenRows="true" > <ListView.ItemTemplate> <DataTemplate>
Xamarin
forms(xaml)的书,其中一个例子是ContentPage
和ListView
:
<ListView ItemsSource="{Binding ListItems}" RowHeight="100" BackgroundColor="Black" HasUnevenRows="true" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout HorizontalOptions="StartAndExpand" Orientation="Horizontal" Padding="5,10,5,15">
<StackLayout HorizontalOptions="Start" Orientation="Vertical">
<Label HorizontalOptions="Start" FontSize="20" FontAttributes="Bold" TextColor="White" Text="{Binding Title}"/>
<Label HorizontalOptions="Start" FontSize="12" FontAttributes="Bold" TextColor="White" Text="{Binding Description}"/>
</StackLayout>
<StackLayout HorizontalOptions="EndAndExpand" Orientation="Horizontal" WidthRequest="260">
<Label HorizontalOptions="Center" FontSize="25" TextColor="Aqua" Text="{Binding Price}"/>
<Button Text="Buy Now" BackgroundColor="Teal" HorizontalOptions="EndAndExpand" Command="{Binding BuyCommand}" />
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
源代码以3列显示数据,完全对齐。我复制的代码在3列中显示相同的数据,但它们没有垂直对齐。另外,
NavigationPage
没有标题,背景为白色。源代码有标题信息和黑色背景。我找不到这些样式的设置位置,也找不到两个项目之间的代码差异。您可以在资源字典中找到必须添加到app.xaml文件中的样式。请检查不是app.xaml,而是app.cs。请提供资源字典所在位置的详细信息。例如,它是在XAML(便携式)项目中还是在Droid项目中?它将在便携式项目中,如果有任何特定于平台的设计更改,那么android项目中将有一些定制文件夹,这正是问题所在。我看不到任何相关文件。portable项目除了app.cs和各种XAML页面之外什么都没有,我复制了这些页面。Droid项目包含组件、资产和资源。我应该在哪里找到为什么一个项目有一个标题、黑色背景、对齐的列,而副本没有标题、白色背景和未对齐的列?你有没有用他们的xaml.cs复制xaml?页面中有没有内联样式?你查过了吗?
MainPage = new NavigationPage(new ListViewButton());