android tabindicator github,GitHub - Kendy6225/Android-TabIndicator: 底部导航

本文介绍了Android Tab Indicator,一个灵活的底部导航组件,提供了丰富的配置选项和控制,展示了简单使用、页面导航及增强导航示例。通过Gradle集成并探讨了XML配置和程序matic API的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

TabIndicator for Android

Tab Indicator is a powerful bottom navigation widget, It provides some configuration options and good control the appearance and operational requirements.

simple example

f08ba0d37b3b4e16463dae11c0780b8c.gif

Page navigation example

60363bc536db25c3e6b78d676ef2cba2.gif

Enhanced Page navigation example

b7afc5464ad57a46b61833053e683022.gif

Using TabIndicator in your application

If you are building with Gradle, simply add the following line to the dependencies section of your build.gradle file:

compile 'com.kevin:tabindicator:1.0.2'

Simple Usage

Configured as View in layout.xml

To add the LoopView to your application, specify com.kevin.tabindicator.TabIndicator in your layout XML.

android:id="@+id/tab_indicator_act_ti"

android:layout_width="match_parent"

android:layout_height="60dp"

android:background="@drawable/tabbg"

kevin:tabSelectedColor="#3F51B5"

kevin:tabSelectedIcons="@array/qq_selected_icon"

kevin:tabTextSize="12sp"

kevin:tabUnselectedColor="#555555"

kevin:tabUnselectedIcons="@array/qq_normal_icon" />

Configured Programmatically

TabIndicator mTabIndicator = (TabIndicator) this.findViewById(R.id.tab_indicator_act_ti);

mTabIndicator.setOnTabSelectedListener(new TabPageIndicatorEx.OnTabSelectedListener() {

@Override

public void onTabSelected(int index) {

mTextView.setText("Page"+(index+1));

}

});

More configuration Usage

XML Usage

If you decide to use TabIndicator as a view, you can define it in your xml layout like this:

Programme Usage

// set ViewPager

mTabPageIndicatorEx.setViewPager(mViewPager);

// Setting specifies the position indicator to show whether or not the point

mTabPageIndicatorEx.setIndicateDisplay(2, true);

// Monitor switch settings

mTabPageIndicatorEx.setOnTabSelectedListener(new TabPageIndicatorEx.OnTabSelectedListener() {

@Override

public void onTabSelected(int index) {

mViewPager.setCurrentItem(index, false);

}

});

License

Copyright 2015 Kevin zhou

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

http://www.apache.org/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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值