Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

选中时没有 Indicator #26

Open
Pingsh opened this issue Apr 27, 2018 · 1 comment
Open

选中时没有 Indicator #26

Pingsh opened this issue Apr 27, 2018 · 1 comment

Comments

@Pingsh
Copy link

Pingsh commented Apr 27, 2018

TabStrip 的 ondraw 里绘制矩形不是最好的处理办法, 会造成图层遮挡, 在不同的安卓版本有不同体现, 部分可能运行成功, 比如 魅族 mx4; 部分不成功, 比如 魅族 mx6, 自定义view绘制顺序 初始化时: 在 addTabWithMode方法 选中目标, 直接对 mSelectedTab 进行初始化; 后续选中: 在 setTabSelected 方法 对 mSelectedTab 进行操作

@Pingsh
Copy link
Author

Pingsh commented Apr 27, 2018

TabStrip 类中 setIndicatorGravity 方法里, 获取 mIndicatorWidth 的操作, 建议不要通过 post 操作实现, 数据量大的情况下, 无法及时通过 getWidth 获取宽度, 建议利用 ViewTreeObserver.OnGlobalLayoutListener 获取

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant