'the hight of tab bar is very big in xamarin forms
here the code Xaml
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CCSN.Views.TopBarProfile"
Title="CCSN"
></TabbedPage>
cs
public TopBarProfile(Patient patient )
{
InitializeComponent();
NavigationPage.SetHasBackButton(this, true);
var navigationDetails = new NavigationPage(new PatientProfileDetailsPage(patient));
navigationDetails.Title = "Patient Details";
var navigationFollow = new NavigationPage(new PatientProfileFollowUpPage());
navigationFollow.Title = "Patient Follow Up";
Children.Add(navigationDetails);
Children.Add(navigationFollow);
}
}
}
how can in set the hight of the tabbed page and set it in the button of the vav bar?
Solution 1:[1]
What does the hight of tab bar is very big mean? The default value of TabLayout's height is wrap content. So the hight of tab bar is according to the content such as the text size. You can post the picture to describe the problem.
In addition, you can custom a tablayout and set the value of the text size.
Create the TabLayout.xml in the layout folder which should be create in the Resources folder in the android part.
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.tabs.TabLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tabLayout1"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:tabTextAppearance="@android:style/TextAppearance.Holo.Small"/>
In the MainActivity, put the following code first line.
TabLayoutResource = Resource.Layout.TabLayout;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Liyun Zhang - MSFT |
