我正在使用 TabbedPage 在xaml. 默认选项卡图标和文本大小很大,所以我需要减小图标和文本的大小。下面是我main.xaml设置图标的代码。
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:TabbedApp">
<local:DairyTabs Icon="dairy" HeightRequest="10" WidthRequest="10" ></local:DairyTabs>
<local:Mykid Icon="kid" ></local:Mykid>
<local:Event Icon="about"></local:Event>
</TabbedPage>
Run Code Online (Sandbox Code Playgroud)
这是选项卡的第一页,我将选项卡的标题指定为 Title="Dairy"
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title="Dairy">
<ContentPage.Content>
<StackLayout>
<Button x:Name="btnDemo" Text="Go for 2nd page"></Button>
</StackLayout>
</ContentPage.Content>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)
请参阅下面的屏幕截图,您可以在其中看到图标和标签文本。