您好我正在尝试实现一个没有边距的底部按钮栏,但行为不是预期的。
我的按钮在 stackLayout 中变平了,它们看起来不错,但有边距。
您还可以看到,在第一张图像中,“D”图像在底部被切割,滚动视图和按钮之间似乎有一个间距,我该如何删除它?
是)我有的
var consultorButtons = new Grid()
{
VerticalOptions = LayoutOptions.EndAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand,
Margin = new Thickness(0),
Padding = new Thickness(0),
RowSpacing = 0,
ColumnSpacing = 0,
};
consultorButtons.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
consultorButtons.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
consultorButtons.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
consultorButtons.Children.Add(
new Button
{
Text = "TELEFONAR",
BackgroundColor = Color.FromHex("#21c9ae"),
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Margin = new Thickness(0),
FontSize = 14
}, 0, 0);
consultorButtons.Children.Add(
new Button
{
Text = "EMAIL",
BackgroundColor = Color.FromHex("#272f57"),
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
TextColor = Color.White,
Margin = new Thickness(0),
FontSize = 14
}, 1, 0);
网格
堆栈布局