2017-07-26 90 views
1

我有一个StackLayout和一个标签,两者之间的间距非常大,我想减小两个尽可能接近的距离,用什么方式来做这个如何减少项目之间的间距xamarin形式

 <ScrollView BackgroundColor="#ffffff" Padding="15"> 
    <StackLayout HorizontalOptions="Fill" VerticalOptions="FillAndExpand"> 
     <Image Source="{Binding Image}" HeightRequest="200" x:Name="image"> 
       <Image.GestureRecognizers> 
       <TapGestureRecognizer Tapped="OnTapped" /> 
       </Image.GestureRecognizers> 
      </Image> 

     <StackLayout Orientation="Horizontal" Spacing="0"> 
      <Button x:Name="Amais" Text="A+" /> 
      <Button x:Name="Amenos" Text="A-" /> 
     </StackLayout> 

     <Label x:Name="webView" VerticalOptions="FillAndExpand" FontSize="18"/> 
    </StackLayout> 
</ScrollView> 

enter image description here

回答

0

*编辑:让我们试试这个再次,在设置Spacing0StackLayout并删除了和父母StackLayout。这会让你获得结果吗?

<ScrollView BackgroundColor="#ffffff" Padding="15"> 
    <StackLayout HorizontalOptions="Fill" Spacing="0"> 
     <Image Source="{Binding Image}" HeightRequest="200" x:Name="image"> 
       <Image.GestureRecognizers> 
       <TapGestureRecognizer Tapped="OnTapped" /> 
       </Image.GestureRecognizers> 
      </Image> 

     <StackLayout Orientation="Horizontal"> 
      <Button x:Name="Amais" Text="A+" /> 
      <Button x:Name="Amenos" Text="A-" /> 
     </StackLayout> 

     <Label x:Name="webView" FontSize="18"/> 
    </StackLayout> 
</ScrollView> 
+0

什么都没有改变,同一个发散 –

+0

看看上面 –

+0

照片@何退房根据您的编辑新的代码 – hvaughan3

相关问题