【发布时间】:2022-01-17 00:23:02
【问题描述】:
我有一个带有一个按钮和两个标签的 StackLayout。
我想删除 StackLayout 和按钮之间的空白。
我使用 Spacing = "0" 但这不适合我。
<StackLayout VerticalOptions="EndAndExpand"
HorizontalOptions="EndAndExpand"
Spacing="0">
<Button Text="ОФИЦИАЛЕН WEB САЙТ"
VerticalOptions="CenterAndExpand"
HorizontalOptions="Center"
Clicked="OnButtonClickedWeb"
x:Name="webButton"
WidthRequest="150"
HeightRequest="30"
FontSize="10"/>
<Label Text="Създаден от Благовест Пижев, тел: +359 899 91 66 79, е-mail: pizhevsoft@gmail.com"
HorizontalOptions="CenterAndExpand"
VerticalOptions="EndAndExpand"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontAttributes="Bold"
FontSize="10"
TextColor="White"/>
<Label Text="Финансирано по програма ННП 'Млади учени, докторанти и постдокторанти.' от МОН. НИМХ - Филиал Пловдив."
HorizontalOptions="EndAndExpand"
VerticalOptions="EndAndExpand"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontAttributes="Bold"
FontSize="10"
TextColor="White"/>
</StackLayout>
当我使用 HeighRequest 时,标签的歌词不可见并向下显示。
【问题讨论】:
-
你确定问题不在 StackLayout 和它之前的任何元素之间吗?
-
当我输入 HeightRequest = "200" 时,stacklayout 正在缩小,我无法将高度降低到 90 以下。为什么?
-
我不知道这与我问你的问题有什么关系。我建议您将 BG 颜色分配给 UI 中的所有元素,以便您可以直观地看到间距的实际位置。