androidkun / xtablayout Goto Github PK
View Code? Open in Web Editor NEWAdded support to modify text size and indicator width based on the original TabLayout.
Added support to modify text size and indicator width based on the original TabLayout.
左边现在是直角的矩形,想要圆润效果,大佬能提供升级吗?
在 public void setSelected(boolean selected) {}方法中 final boolean changed = (isSelected() != selected); 这个changed是不是为false啊,那么 if (changed && selected) {}这个方法就不会执行,是不是第一次被选中就不会被加粗啊?
谢谢作者
现有版本的tablayout已经废弃了setOnTabSelectedListener而用addOnTabSelectedListener取而代之了,用set方法比如setupWithViewPager后就不能监听tabselector了,因为listener回调方法被覆盖了
tab右上角没有设置badgeView消息红点的功能
设置 app:xTabTextSize="@dimen/sp_18"
app:xTabSelectedTextSize="@dimen/sp_18"
属性后首页三个tab 第一个大小为18 后两个大小都是默认大小
切换一次tab,后面两个大小变为正常大小。这个问题该怎么处理呢?
手机是VIVO X6s
08-21 09:39:25.260 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.260 16587-16587/com.itwangxia.hackhome W/AAA: title:网游榜
08-21 09:39:25.260 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.260 16587-16587/com.itwangxia.hackhome W/AAA: title:单机榜
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/AAA: title:点击榜
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/AAA: title:热搜榜
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/AAA: title:好评榜
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/AAA: title:网游榜
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.270 16587-16587/com.itwangxia.hackhome W/AAA: title:单机榜
08-21 09:39:25.280 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.280 16587-16587/com.itwangxia.hackhome W/AAA: title:点击榜
08-21 09:39:25.280 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.280 16587-16587/com.itwangxia.hackhome W/AAA: title:热搜榜
08-21 09:39:25.280 16587-16587/com.itwangxia.hackhome W/BBB: getTabMinWidth
08-21 09:39:25.280 16587-16587/com.itwangxia.hackhome W/AAA: title:好评榜
大神,文字和indicator之间的距离怎么控制?
使用 xTabSelectedBackgroundColor 设置一个shape背景 直接报错了。
因为要实现一行 XTabLayout 中间有只有 3个 XTabItem ,且3个都在 XTabLayout的中间的效果。
TabLayout有属性 tabGravity="center" 设置3个item 就会跑到中间。但是使用XTabLayout 这个属性不能设置
center ,我查找了下属性中怎么让设置 Integer 的值,那么这个值应该设置多少?我目前设置1发现可以,求讲解!
<com.androidkun.xtablayout.XTabLayout
android:id="@+id/good_detail_tab"
android:layout_width="match_parent"
android:layout_height="@dimen/view_size_55"
android:isScrollContainer="false"
android:layout_marginLeft="@dimen/view_size_50"
android:layout_toLeftOf="@+id/good_detail_share"
android:layout_toRightOf="@+id/good_detail_back"
android:layout_centerHorizontal="true"
android:scrollbars="none"
android:paddingLeft="@dimen/view_size_10"
android:paddingRight="@dimen/view_size_10"
app:xTabIndicatorColor="@color/colorWhite"
app:xTabIndicatorHeight="@dimen/view_size_3"
app:xTabIndicatorWidth="@dimen/view_size_40"
app:xTabMode="fixed"
app:xTabSelectedTextColor="@color/colorWhite"
app:xTabSelectedTextSize="@dimen/font_size_18"
app:xTabTextColor="@color/colorWhite"
app:xTabTextSize="@dimen/font_size_16" />
我的 app:xTabMode已经设置成 app:xTabMode="fixed",tab还是可以滑动
Ok. Sorry. Same as every layout using the android:elevation
attribute.
当tab的名字太长会多行显示,怎么样限制一行显示?
我试过
xTablayout.addTab(xTablayout.newTab().setText(title));
和这样设置
xTablayout.addTab(xTablayout.newTab().setCustomView(txtView));
但是当文本过长时,都会多行显示,怎么样单行显示?
tabLayout.getTabAt(2).setCustomView(View),View布局是TextView+右上角的TextView,但是设置 app:xTabDividerWidthWidthText="true"这个属性就不管用啦,指示器长度会比文字短一些,请问如何用自定义布局的时候也能保持线的长度跟文字长度一样
像仿微博那种
很卡的那种。有解决办法吗。急
我设置了setupWithViewPager后,指示器显示,但是标题不显示。
然后我通过如下设置:
mVpProduct.setAdapter(productFragmentAdapter);
tabLayout.setupWithViewPager(mVpProduct);
productFragmentAdapter.notifyDataSetChanged();
tabLayout.addTab(tabLayout.newTab().setText("火爆专区"));
tabLayout.addTab(tabLayout.newTab().setText("固收理财"));
tabLayout.addTab(tabLayout.newTab().setText("转让专区"));
指示器的位置和标题的位置错乱!
文字和indicator之间的距离怎么控制?
如何改变为第三方字体
可以嵌套在adpter里面吗
你好,第一次初始化TabLayout时,只有默认选中的tab有背景色,其他的背景色都是白的,即使你已经设置了未选中的背景色,点击切换tab之后就正常了,不知为啥?
set textAllCaps false,but not work
只有选中后,才能设置过来
app:xTabSelectedTextSize="34px"
app:xTabTextSize="34px"
进入界面后,所有字体为一个size,滑动后,所有字体都同时变大一个size
点击TAb不能ViewPager不会跟着翻页?
”compile“ will be removed at the end of 2018.So please change this!
如果调用xTabPaddingEnd设置距离,指示器位置不对
为什么最开始加载的时候字体是加粗加黑的,切换一下有个明显的变化?
打印了很多标题文本
啥时可以添加一下shape背景的支持
能单纯的设置文本内容吗?
现在的底部的指示器都是贴底边的,能否搞成可以设置marginBottom以及给指示器指定一个style
如题,如果没有addOnTabSelectedListener方法xtablayout设置点击set方法会与之前的点击事件冲突
dividerWidth = a.getDimensionPixelSize(R.styleable.XTabLayout_xTabDividerWidth, 0);
没理解为啥点击括号的代码能跳转到
这个是命名自带的特点吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.