如图两控件之间有间距:
QQ截图20190724160707.png
想要效果:
QQ截图20190724161745.png
问题代码如下:
<StackLayout Orientation="Vertical" BackgroundColor="LightSeaGreen" VerticalOptions="Center" HorizontalOptions="Start" Padding="15" >
<StackLayout.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="1" Tapped="Button_OnClicked_toSininorsignout"/>
</StackLayout.GestureRecognizers>
<Image Source="{local:ImageResource CameraFTP.Timelapse.Shared.images.login.png}" HeightRequest="20" WidthRequest="20" VerticalOptions="Center" HorizontalOptions="Center" BackgroundColor="Black"></Image>
<Label Text="{StaticResource Mainpage_logon}" TextColor="{StaticResource textColorWhite}" FontSize="12" VerticalOptions="Start" HorizontalOptions="Center" BackgroundColor="Blue"></Label>
</StackLayout>
如图黑色和深蓝控件间有间距,怎么调都去不掉,搞了好久,改进代码如下,仅仅在第一行里加了Spacing="0":
<StackLayout Orientation="Vertical" BackgroundColor="LightSeaGreen" VerticalOptions="Center" HorizontalOptions="Start" Padding="15" Spacing="0">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="1" Tapped="Button_OnClicked_toSininorsignout"/>
</StackLayout.GestureRecognizers>
<Image Source="{local:ImageResource CameraFTP.Timelapse.Shared.images.login.png}" HeightRequest="20" WidthRequest="20" VerticalOptions="Center" HorizontalOptions="Center" BackgroundColor="Black"></Image>
<Label Text="{StaticResource Mainpage_logon}" TextColor="{StaticResource textColorWhite}" FontSize="12" VerticalOptions="Start" HorizontalOptions="Center" BackgroundColor="Blue"></Label>
</StackLayout>
网友评论