发布:2023/12/7 15:31:14作者:大数据 来源:大数据 浏览次数:468
https://stackoverflow.com/questions/45478735/how-to-make-tabbed-page-of-many-content-page-with-a-scroll-menu-in-xamarin-forms/45485591#45485591
xaml文件:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?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:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="App2.TabbedPage1"> <!--Pages can be added as references or inline--> <ContentPage Title="Tab 1" /> <ContentPage Title="Tab 2" /> <ContentPage Title="Tab 3" /> <ContentPage Title="Tab 4" /> <ContentPage Title="Tab 5" /> <ContentPage Title="Tab 6" /> <ContentPage Title="Tab 7" /> <ContentPage Title="Tab 8" /> <ContentPage Title="Tab 9" /> </TabbedPage> |
将android中的tabbar.xml修改如下,注意红色字体,默认为:
1 |
<span class="pln">app</span><span class="pun">:</span><span class="pln">tabMode</span><span class="pun">=</span><span class="str">"fixed"</span> |
1 2 3 4 5 6 7 8 9 10 11 |
<?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/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:tabIndicatorColor="@android:color/white" app:tabGravity="fill" app:tabMode="<span style="color: #ff0000;">scrollable</span>" /> |
© Copyright 2014 - 2024 柏港建站平台 ejk5.com. 渝ICP备16000791号-4