StackLayout has a "Spacing" property
xamarin.forms.stacklayout.spacing
you can try to set it to 0, then set "margin" to 0 from Frame and Button
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to put a frame and a button side by side and adjoining but when i do that, there is always a space between them and i can't remove it. Here is the code i wrote:
<StackLayout Margin="0,740,0,0" Orientation="Horizontal" >
<Frame BackgroundColor="#BD3AB8" HeightRequest="20" WidthRequest="380">
<Label Text="TOPLAM: 50 TL" TextColor="White" FontSize="17" />
</Frame>
<Button Text="SİPARİŞİ ONAYLA" TextColor="White" WidthRequest="160" FontSize="17" BackgroundColor="Purple" Padding="0"/>
</StackLayout>
and the result looks like this:
]1
i want to remove that space that showed with arrow. How can i solve this problem?
StackLayout has a "Spacing" property
xamarin.forms.stacklayout.spacing
you can try to set it to 0, then set "margin" to 0 from Frame and Button
Hello,
Welcome to our Microsoft Q&A platform!
For this function, try setting the Spacing property of the layout to 0. The Spacing property indicates the amount of space between each child element. It seems you set the value of margin top to '740'. Do you want to place the stackLayout at the bottom of the page? If so, just set the VerticalOptions to End or EndAndExpand.
Check the code:
<StackLayout VerticalOptions="End" Orientation="Horizontal" Spacing="0">
<Frame BackgroundColor="#BD3AB8" HeightRequest="20" WidthRequest="380" IsClippedToBounds="True">
<Label Text="TOPLAM: 50 TL" TextColor="White" FontSize="17" Padding="0"/>
</Frame>
<Button Text="SİPARİŞİ ONAYLA" TextColor="White" WidthRequest="160" FontSize="17" BackgroundColor="Purple"/>
</StackLayout>
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.