Is there a wat to make a indicator like this?
it has some pointed arrow down like in the selected item?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
now it doesn't work, tintmanager class is removed from support library 23.2.0 , I managed same functionality by changing background drawable at runtime inside for loop detecting clicked position , PS : check this question and answer I am using same library : https://github.com/astuetz/PagerSlidingTabStrip/issues/141
The only solution I could find is to grab the source code of the original
TabLayout
and customize it, according your needs.In fact, all you need to do to get this custom pointing arrow is to override
SlidingTabStrip
'svoid draw(Canvas canvas)
method. Unfortunately,SlidingTabStrip
isprivate
inner class insideTabLayout
.Luckily, all support library code is open, so we can create our own
TabLayoutWithArrow
class. I replaced the standardvoid draw(Canvas canvas)
by this one to draw the arrow:Of course, the background, the particular design of the indicator can be improved/adjust according your needs.
To make my custom
TabLayoutWithArrow
, I had to copy these files into my project:To have transparency behind the arrow, you just need to set this
Shape
-drawable
, as abackground
for theTabLayoutWithArrow
:And the actual usage is:
I've uploaded the whole project (the TabLayoutWithArrow + one-page app which is using it) to my dropbox - feel free to check it out.
I hope, it helps