0

客户希望主选项卡出现在 iOS 的底部和 Android 的顶部。使用Shell时这可能吗?我知道嵌套/辅助选项卡可以出现在顶部,但我再次指的是主/顶级选项卡。Shell 是否强制主选项卡始终为底部选项卡,或者是否有办法将它们也显示在顶部?

4

1 回答 1

1

抱歉,Shell 强制主标签始终位于底部,我们无法修改。

shell tabbar 的布局设计为默认。您可以在这里查看Shell 的源代码

public override AView OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        if (_shellContent != null)
        {
            _page = ((IShellContentController)_shellContent).GetOrCreateContent();
        }

        _root = inflater.Inflate(Resource.Layout.ShellContent, null).JavaCast<CoordinatorLayout>();

       //here layout be designed as default 
        _toolbar = _root.FindViewById<Toolbar>(Resource.Id.shellcontent_toolbar);

        _renderer = Platform.CreateRenderer(_page, Context);
        Platform.SetRenderer(_page, _renderer);

         ...

        return _root;
    }

最后如你所说,建议不使用 Shell 来实现是可能的。

于 2020-06-11T08:37:56.350 回答