【发布时间】:2021-04-12 01:56:29
【问题描述】:
我在底部有四个标签,问题是,最后一个标签标题不完全可见,我想通过将标签模式设置为可滚动它会设置,即使我将tabmode 设置为可滚动问题存在。
这是我的 xaml 代码:
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
android:TabbedPage.BarItemColor="LightGray"
android:TabbedPage.BarSelectedItemColor="White"
android:TabbedPage.IsSmoothScrollEnabled="True"
x:Class="MyApp.Views.DashBoardTabbedPage" BarBackgroundColor="#00abbf">
<!--Pages can be added as references or inline-->
</TabbedPage>
xaml.cs 构造函数
var _dashboardview = new DashBoard();
_dashboardview.Title = "1";
_dashboardview.IconImageSource = "refresh";
this.Children.Add(_dashboardview); //Added other 3 tabs in this way
On<Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
【问题讨论】:
-
你为什么在原生 android 中做标签而不是共享的 xaml 视图?
-
请澄清,因为您的问题是关于 Xamarin.Forms(使用 xaml),而您的代码是 Xamarin.Android(本机,使用 xml),这是完全不同的。那么 Xamarin.Forms 还是 Xamarin.Android?
-
我已经在共享自己@o_w中定义了tabbedpage,代码供参考我如何定义tabMode。
-
对不起@Cfun 的困惑,我正在使用 xaml。我将更新我的 xaml 代码。
-
我已经更新了我的代码@o_w
标签: xaml xamarin.forms scrollable tabbedpage bottomtabs