I have a XF application using Toolbar which was added to my ContentPage like below:
public HomePage()
{
InitializeComponent();
var toolbarItem = new ToolbarItem
{
Text="Item1",
Priority = 0,
Order = ToolbarItemOrder.Primary,
};
if(Device.RuntimePlatform == Device.Android) {
this.ToolbarItems.Add(toolbarItem);
}
}
I wanted to change the height of the toolbar smaller than the original height. I edited the Toolbar.axml
like below:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/AppToolbarTheme"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="50dp"
android:minHeight="0dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
Unfortunately this has no effect whatsoever. Is there any other way to change the toolbar height?
actionBarSize
resource. Try using a customNavigationPageRenderer
, and get the toolbar there and see if you can set the height of it. github.com/xamarin/Xamarin.Forms/blob/… – sme