如何以 xamarin 形式从顶部删除 space?
How to remove the space from the top in xamarin form?
<?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="WindyBox1.InputPage">
<ContentPage.Content>
<StackLayout BackgroundColor="#2051fb">
<Label Text="WindyBox"
FontSize="15"/>
<CollectionView ItemsSource="{Binding Coolers}"
SelectionMode="Single"
BackgroundColor="#4fa1fb"
SelectionChanged="SelectChanged">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10"
RowDefinitions="Auto, *"
ColumnDefinitions="Auto, *">
<Image Source="Cooler.png"
WidthRequest="80"
HeightRequest="80"
Grid.RowSpan="2"
Grid.Row="0"
Grid.Column="0"/>
<Label Text="{Binding Name}"
Grid.Row="0"
Grid.Column="1"/>
<Label Text="{Binding Condition}"
TextColor="LightGreen"
Grid.Row="1"
Grid.Column="1"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Button Text="Подключиться к устройству"
x:Name="ConnectDeviceButton"
IsEnabled="False"
Clicked="ConnectDeviceButton_Clicked"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
我在顶部得到了一个 space。
如果你开什么药,it still remains。你能告诉我如何从上面删除这个未占用的 space 吗?
我想在那里放一个按钮或其他东西。
enter image description here
它是导航栏。使用 NavigationPage.HasNavigationBar="false"
禁用它
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WindyBox1.InputPage"
NavigationPage.HasNavigationBar="false">
<?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="WindyBox1.InputPage">
<ContentPage.Content>
<StackLayout BackgroundColor="#2051fb">
<Label Text="WindyBox"
FontSize="15"/>
<CollectionView ItemsSource="{Binding Coolers}"
SelectionMode="Single"
BackgroundColor="#4fa1fb"
SelectionChanged="SelectChanged">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10"
RowDefinitions="Auto, *"
ColumnDefinitions="Auto, *">
<Image Source="Cooler.png"
WidthRequest="80"
HeightRequest="80"
Grid.RowSpan="2"
Grid.Row="0"
Grid.Column="0"/>
<Label Text="{Binding Name}"
Grid.Row="0"
Grid.Column="1"/>
<Label Text="{Binding Condition}"
TextColor="LightGreen"
Grid.Row="1"
Grid.Column="1"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Button Text="Подключиться к устройству"
x:Name="ConnectDeviceButton"
IsEnabled="False"
Clicked="ConnectDeviceButton_Clicked"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
我在顶部得到了一个 space。 如果你开什么药,it still remains。你能告诉我如何从上面删除这个未占用的 space 吗? 我想在那里放一个按钮或其他东西。 enter image description here
它是导航栏。使用 NavigationPage.HasNavigationBar="false"
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WindyBox1.InputPage"
NavigationPage.HasNavigationBar="false">