# VerticalTabLayout
[ ![Download](https://api.bintray.com/packages/qstumn/maven/VerticalTabLayout/images/download.svg) ](https://bintray.com/qstumn/maven/VerticalTabLayout/_latestVersion)
垂直竖向的Android TabLayout
![](https://github.com/qstumn/VerticalTabLayout/blob/master/demo.png?raw=true)
### 一些特性
* 支持自定义Indicator大小
* 支持自定义Indicator位置
* 支持Indicator设置圆角
* 支持Tab设置Badge
* 支持Adapter的方式创建Tab
* 多种Tab高度设置模式
* Tab支持android:state_selected
* 很方便的和ViewPager结合使用
* 很方便的和Fragment结合使用
![](https://github.com/qstumn/VerticalTabLayout/blob/master/demo_gif.gif?raw=true)
## how to use:
### 1. gradle
```groovy
compile 'q.rorbin:VerticalTabLayout:1.2.5'
```
VERSION_CODE : [here](https://github.com/qstumn/VerticalTabLayout/releases)
### 2. xml
```xml
<q.rorbin.verticaltablayout.VerticalTabLayout
android:id="@+id/tablayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#EDEDED"
app:indicator_color="#FFFFFF"
app:indicator_gravity="fill"
app:tab_height="50dp"
app:tab_mode="scrollable" />
```
### 3. 属性说明
xml | code | 说明
---|---|---
app:indicator_color | setIndicatorColor | 指示器颜色
app:indicator_width | setIndicatorWidth | 指示器宽度
app:indicator_gravity | setIndicatorGravity | 指示器位置
app:indicator_corners | setIndicatorCorners | 指示器圆角
app:tab_mode | setTabMode | Tab高度模式
app:tab_height | setTabHeight | Tab高度
app:tab_margin | setTabMargin | Tab间距
### 4. 创建Tab的方式
- 普通方式创建
```java
tablayout.addTab(new QTabView(context))
tablayout.addOnTabSelectedListener(new VerticalTabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabView tab, int position) {
}
@Override
public void onTabReselected(TabView tab, int position) {
}
});
```
- Adapter方式创建
```java
tablayout.setTabAdapter(new TabAdapter() {
@Override
public int getCount() {
return 0;
}
@Override
public TabView.TabBadge getBadge(int position) {
return null;
}
@Override
public TabView.TabIcon getIcon(int position) {
return null;
}
@Override
public TabView.TabTitle getTitle(int position) {
return null;
}
@Override
public int getBackground(int position) {
return 0;
}
});
```
按照自己的需要进行返回相应的值即可,不需要的返回0或者null
也可以选择使用SimpleTabAdapter,内部空实现了TabAdapter的所有方法
TabBadge、TabIcon、TabTitle使用build模式创建。
- 结合ViewPager使用
```java
tablayout.setupWithViewPager(viewpager);
```
ViewPager的PagerAdapter可选择实现TabAdapter接口
如果您需要使用垂直竖向的ViewPager,推荐您使用:https://github.com/youngkaaa/YViewPagerDemo
- 结合Fragment使用
```java
tabLayout.setupWithFragment(FragmentManager manager, int containerResid, List<Fragment> fragments, TabAdapter adapter)
```
### 5. 设置badge
```java
int tabPosition = 3;
int badgeNum = 55;
tablayout.setTabBadge(tabPosition,badgeNum);
Badge badge = tablayout.getTabAt(position).getBadgeView();
Badge使用方法请移步https://github.com/qstumn/BadgeView
```
### 6.更新计划
抽象解耦Indicator,实现绘制任意形状Indicator
# LICENSE
```
Copyright 2016, RorbinQiu
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.
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
安卓 竖直选项卡 verticaltablayout_viewpager (2000个子文件)
8O3lQ52P_qx7EPzEWeSWcBf7SQQ= 354KB
verticaltablayout-release.aar 43KB
resources-debug.ap_ 354KB
verticaltablayoutdemo-debug.apk 1.25MB
gradlew.bat 2KB
fileSnapshots.bin 620KB
fileHashes.bin 427KB
taskArtifacts.bin 63KB
localClassSetAnalysis.bin 33KB
localClassSetAnalysis.bin 28KB
localJarClasspathSnapshot.bin 20KB
localJarClasspathSnapshot.bin 19KB
FragmentManagerImpl.class 64KB
FragmentManagerImpl.class 64KB
ViewPager.class 51KB
ViewPager.class 51KB
PatternsCompat.class 44KB
PatternsCompat.class 44KB
Toolbar.class 39KB
AppCompatDelegateImplV9.class 38KB
Fragment.class 36KB
Fragment.class 36KB
SearchView.class 36KB
DrawerLayout.class 33KB
DrawerLayout.class 33KB
NestedScrollView.class 32KB
NestedScrollView.class 32KB
WindowDecorActionBar.class 29KB
MenuBuilder.class 28KB
SwitchCompat.class 26KB
LinearLayoutCompat.class 26KB
SlidingPaneLayout.class 26KB
SlidingPaneLayout.class 26KB
FragmentTransition.class 25KB
FragmentTransition.class 25KB
AccessibilityNodeInfoCompat.class 25KB
AccessibilityNodeInfoCompat.class 25KB
SwipeRefreshLayout.class 23KB
SwipeRefreshLayout.class 23KB
ListPopupWindow.class 23KB
R$styleable.class 22KB
FragmentActivity.class 22KB
FragmentActivity.class 22KB
QBadgeView.class 22KB
R$styleable.class 22KB
R$style.class 22KB
R$style.class 22KB
VectorDrawableCompat.class 22KB
ViewDragHelper.class 21KB
ViewDragHelper.class 21KB
AppCompatDrawableManager.class 21KB
ActionBarOverlayLayout.class 20KB
ViewCompat.class 20KB
ViewCompat.class 20KB
BackStackRecord.class 19KB
BackStackRecord.class 19KB
SuggestionsAdapter.class 19KB
ViewCompat$BaseViewCompatImpl.class 19KB
ViewCompat$BaseViewCompatImpl.class 19KB
ExploreByTouchHelper.class 19KB
ExploreByTouchHelper.class 19KB
VerticalTabLayout.class 18KB
VerticalTabLayout.class 18KB
NotificationCompatImplBase.class 18KB
ToolbarWidgetWrapper.class 18KB
MediaSessionCompat$MediaSessionImplBase.class 18KB
ActionMenuPresenter.class 18KB
ToolbarActionBar.class 17KB
ActionMenuView.class 17KB
AlertController.class 17KB
IMediaSession$Stub$Proxy.class 17KB
MediaSessionCompat$MediaSessionImplBase.class 17KB
AnimatedVectorDrawableCompat.class 17KB
MenuItemImpl.class 17KB
MediaBrowserCompat$MediaBrowserImplBase.class 17KB
CascadingMenuPopup.class 16KB
AccessibilityNodeInfoCompat$AccessibilityNodeInfoStubImpl.class 16KB
AccessibilityNodeInfoCompat$AccessibilityNodeInfoStubImpl.class 16KB
NotificationCompat.class 15KB
MediaBrowserCompat$MediaBrowserImplBase.class 15KB
NotificationCompatJellybean.class 15KB
NotificationCompatJellybean.class 15KB
IMediaSession$Stub$Proxy.class 14KB
FragmentTransitionCompat21.class 14KB
FragmentTransitionCompat21.class 14KB
MediaBrowserCompat$MediaBrowserImplApi21.class 14KB
ActionBarContextView.class 14KB
MediaBrowserServiceCompat.class 13KB
ActivityChooserModel.class 13KB
AppCompatSpinner.class 13KB
NotificationCompat$Builder.class 13KB
NotificationCompat$Builder.class 13KB
NotificationCompat$WearableExtender.class 13KB
NotificationCompat$WearableExtender.class 13KB
ActivityChooserView.class 13KB
PagerTitleStrip.class 13KB
PagerTitleStrip.class 13KB
MediaControllerCompat$MediaControllerImplApi21.class 12KB
NotificationCompat.class 12KB
MediaBrowserServiceCompat.class 12KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- wangjammi2019-06-14非常好用,感谢楼主的分享!
徐朵朵的小太阳
- 粉丝: 56
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功