xaml - xamarin 形式的不必要的条带
问题描述
在移动设备上编译时,会出现一个不在代码中的空行。在设计师的工作室里一切都很好,但在电话里一切都不同了。错误可能在哪里?
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="4*"/>
</Grid.RowDefinitions>
<Grid Row="0" ColumnSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid Column="0">
<SearchBar x:Name="SearchNickname"
BackgroundColor="{Binding BackColor}"
CancelButtonColor="{Binding TextColor}"
PlaceholderColor="{Binding TextColor}"
TextColor="{Binding TextColor}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
Placeholder="Введите свой ник"
SearchCommand="{Binding SearchCmd}"
Text="{Binding SearchText, Mode=TwoWay, UpdateSourceEventName=TextChanged}"
MaxLength="100"/>
</Grid>
<Grid Column="1" BackgroundColor="{Binding BackColor}">
<Button ImageSource="https://assets.laut.fm/f69a3423e545055c32430e0a77ebe148?t=_120x120"
BackgroundColor="{Binding BackColor}"
Command="{Binding SettingsCmd}"/>
</Grid>
</Grid>
这条带子是哪里来的?在此处输入图像描述
设计师工作室中的图像 在此处输入图像描述
解决方案
顶部的那个条带是页眉/导航栏,默认情况下您可以在 Xamarin 表单页面中获得它。您可以修改或抑制它。
推荐阅读
- javascript - 用子组件状态响应提交数据
- python-sphinx - Sphinx 文档中的人类可读迭代
- list-comprehension - 使用列表推导消除列表中包含另一个列表中的子字符串的字符串
- simulation - 如何在 SUMO 中改变边缘的交通流向?
- scala - 是否可以使用宏来修改生成的结构化类型实例调用代码?
- pdf - 使用 CA 服务设置服务器以验证我的组织发布的 PDF 的过程
- python - Tkinter 检查按钮在选中时更新,但在我取消选中时不更新
- wordpress - 如何使用模式 - WordPress
- javascript - 试图在页面滚动时对背景产生一些影响
- javascript - 如何从 TS/JS 中的方法或构造函数获取返回值?