Hy guys, I'm doing a Xamarin.Forms app, as you can see this is my app now:
BottomBarPage
In this screenshot, you can see my App.xaml.cs, where I upload StartPage() which is a BottomBarPage.
public App()
{
InitializeComponent();
//MainPage = new Login();
NavigationPage nav = new NavigationPage(new StartPage());
Image img = new Image();
img.Source = "about_us.png";
Label label = new Label();
label.Text = "My App";
label.VerticalTextAlignment = TextAlignment.Center;
label.TextColor = Color.Black;
StackLayout stack = new StackLayout();
stack.Children.Add(img);
stack.Children.Add(label);
nav.SetValue(NavigationPage.TitleViewProperty, stack);
//nav.SetValue(NavigationPage.TitleProperty, stack);
nav.SetValue(NavigationPage.BarBackgroundColorProperty, Color.FromHex("#D60000"));
MainPage = nav;
}
As you can see in my first screen, in the App() I'm trying to add to the navigation bar a title and the app icon but doesn't work, what should I do to add it?
Since Xamarin.Forms 3.2.0 you could place the following layout in StartPage.xaml :
<NavigationPage.TitleView>
<StackLayout Orientation="Horizontal" BackgroundColor="#D60000">
<Image Source="about_us.png" />
<Label Text="My App" VerticalTextAlignment="Center"/>
</StackLayout>
</NavigationPage.TitleView>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With