How to make the Buttons appear in one line
This is my Code behind
namespace RowCounter.Forms
{
public partial class MainPage : ContentPage
{
public int Number = 1;
public MainPage()
{
InitializeComponent();
}
public object Children { get; private set; }
void OnButtonClicked(object sender, EventArgs e)
{
Button button = new Button
{
Text = "NAME PRODJECT"+" "+ Number,
TextColor= Color.Red,
WidthRequest =450,
HorizontalOptions = LayoutOptions.Start
};
Button button2 = new Button
{
Text = "X",
WidthRequest = 40,
HorizontalOptions = LayoutOptions.End
};
MainStackLayout.Children.Add(button2);
MainStackLayout.Children.Add(button);
Number++;
}
}
}
and my xaml code
<StackLayout x:Name ="MainStackLayout" BackgroundColor="#9370db">
<Button Text="СОЗДАТЬ ПРОЕКТ"
FontAttributes="Bold"
FontSize="25"
WidthRequest="250"
HeightRequest="80"
Clicked="OnButtonClicked"
TextColor="#ff000000"
BackgroundColor="#4b0082"/>
</StackLayout>
please help me


