Issue
What's the best way to create header panel for my app? I want to have something like this: app_example
Instead of "ChrunchifyCalculator" I need to place there my app icon and name.
This is my solution structure: solution_structure
Should I use Toolbar.xml from testHeader.Android -> Resources or it's not the right way?
Solution
You can customize the toolbar by using NavigationPage.TitleView
.
You can even add header-bar (Status Bar) from the resource file of the Droid project.
Use the below snippet for adding Customised Header.
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
.
.
.>
<NavigationPage.TitleView>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="8*"/>
</Grid.ColumnDefinitions>
<Icon source="YOUR_ICON.png" Grid.Column="0"/>
<Label Grid.Column="1" Text="APP_NAME" TextColor="#ffffff" FontSize="Large" HorizontalOptions="Center" HorizontalTextAlignment="Center" FontAttributes="Bold"/>
</Grid>
</NavigationPage.TitleView>
<ContentPage.Content>
<-- YOUR XAML CODE -->
</ContentPage.Content>
</ContentPage>
Answered By - Blu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.