如何在Xamarin表单中使用滚动菜单使多个内容页面的选项卡式页面成为标准页面? [英] How to make Tabbed page of many content page with a scroll menu in Xamarin forms?

查看:231
本文介绍了如何在Xamarin表单中使用滚动菜单使多个内容页面的选项卡式页面成为标准页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个包含7个内容页面的选项卡式页面(以xamarin形式,而不是在本机项目中).但是红色的菜单栏(我不知道这个东西叫什么,所以我称它为菜单栏)不是滚动菜单,因此每个内容页面的标题显示得不好.像这样:

I want to make a tabbed page with 7 content page (in xamarin forms, NOT in native project). but the menu bar in red (I don't know what this thing is called so I call it menu bar) is not a scroll menu, so the title of each content page is not shown well. Like this:

我实际上拥有的东西

the thing that I actually have

有人知道要做出这样的事情吗?

Somebody knows to make something like this?

我希望成为的东西

thing that I want it to be

推荐答案

好吧,如果不看一些代码,就不能说太多! -但我的假设是您的问题出在主题上...

Well cannot say much without seeing some code! - but my assumption is that your problem is with your theme...

打开您的"Tabbar.axml"并更改以下代码行:

Open up your 'Tabbar.axml' and change this line of code:

app:tabMode="fixed" 

收件人:

app:tabMode="scrollable"

更新:

然后只需添加新行app:tabMode="scrollable",因为默认情况下为固定"

Then simply add the new line app:tabMode="scrollable" because by default is "fixed"

无论如何,这里都是我的Tabbar.axml:

Anyways as you requested here is my Tabbar.axml :

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.TabLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/sliding_tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimaryDark"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    app:tabIndicatorColor="@android:color/white"
    app:tabGravity="fill"
    app:tabMode="scrollable" />

这篇关于如何在Xamarin表单中使用滚动菜单使多个内容页面的选项卡式页面成为标准页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆