ViewPagerIndicator 6.0.3

dotnet add package ViewPagerIndicator --version 6.0.3                
NuGet\Install-Package ViewPagerIndicator -Version 6.0.3                
此命令旨在在Visual Studio的包管理器控制台中使用,因为它使用NuGet模块的Install-Package版本。
<PackageReference Include="ViewPagerIndicator" Version="6.0.3" />                
对于支持PackageReference的项目,请将此XML节点复制到项目文件以引用该包。
paket add ViewPagerIndicator --version 6.0.3                
#r "nuget: ViewPagerIndicator, 6.0.3"                
#r指令可以在F# Interactive和Polyglot Notebooks中使用。将其复制到交互工具或脚本的源代码中以引用该包。
// Install ViewPagerIndicator as a Cake Addin
#addin nuget:?package=ViewPagerIndicator&version=6.0.3

// Install ViewPagerIndicator as a Cake Tool
#tool nuget:?package=ViewPagerIndicator&version=6.0.3                

ViewPagerIndicator

CI

与AndroidX库中的ViewPager兼容的分页指示器小部件,可提高内容的可发现性。

有关Material Design,请参阅

用法

有关此项目的示例实现,请参阅sample解决方案。

  1. 在视图中包括这些小部件中的一个。这通常应放置在与表示的ViewPager相邻的位置。

    <dk.ostebaronen.droid.viewpagerindicator.TitlePageIndicator
       android:id="@+id/titles"
       android:layout_height="wrap_content"
       android:layout_width="match_parent" />
    
  2. 在您的OnCreate方法(对于片段,则为OnCreateView)中,将指示器绑定到ViewPager

    //Set the pager with an adapter
    var pager = FindViewById<ViewPager>(Resource.Id.pager);
    pager.Adapter = new TestAdapter(SupportFragmentManager);
    
    //Bind the title indicator to the adapter
    var titleIndicator = FindViewById<TitlePageIndicator>(Resource.Id.titles);
    titleIndicator.SetViewPager(pager);
    
  3. (可选) 如果您想监听PageChange事件,则应在ViewPagerIndicator上使用,而不是在ViewPager上设置OnPageChangeListener,否则指示器将不会更新。

    //continued from above
    titleIndicator.PageChange += MyPageChangeEventHandler;
    

主题化

有三种方法可以美化指示器的外观。

  1. 主题XML。为每种类型的指示器提供属性,可以在此指定自定义样式。
  2. 布局XML。通过使用自定义命名空间,可以包含任何需要的样式。
  3. 对象方法。两种样式都有Properties,其中可以更改每个样式属性,可以在任何时刻更改。

每个指示器都有一个演示,它使用这些方法中的每一种创建相同的外观。

包含到您的项目中

ViewPagerIndicator 是一个支持Android的库项目,您可以在Android项目中引用它。

此项目依赖于 Android 支持库中的 ViewPager 类。

  • Tomasz Cielecki 翻译成Xamarin.Android

最初由

许可协议

  Copyright 2013 Tomasz Cielecki
  Copyright 2012 Jake Wharton
  Copyright 2011 Patrik Åkerfeldt
  Copyright 2011 Francisco Figueiredo Jr.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     https://apache.ac.cn/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
产品 兼容和另外的一些计算目标框架版本。
.NET net6.0-android31.0 是兼容的。 net7.0-android 是计算出来的。 net8.0-android 是计算出来的。
MonoAndroid monoandroid12.0 是兼容的。
兼容的目标框架
包含的目标框架(在包中)
了解更多关于 目标框架.NET Standard 的信息。

NuGet 包

此包未被任何 NuGet 包使用。

GitHub 代码库

此包未被任何流行的 GitHub 代码库使用。

版本 下载 最后更新
6.0.3 1,958 6/11/2022
5.0.0 15,814 8/28/2020
0.4.0 2,222 11/4/2019
0.3.0 5,835 6/10/2019
0.2.2 595 6/10/2019
0.2.1 3,774 4/25/2018