最贊回答 / JieProxy
是不是在scoll方法里把那個positionOffset?強(qiáng)轉(zhuǎn)成int了?那個范圍是[0,1) 應(yīng)該乘完最后再轉(zhuǎn)成int
2016-05-17
高亮文本
private void highlightTextView(int pos) {
for (int i = 0; i < getChildCount(); i++) {
View view = getChildAt(i);
if (view instanceof TextView) {
((TextView)view).setTextColor(默認(rèn)顏色);
if (i == pos)
((TextView)view).setTextColor(高亮顏色);
private void highlightTextView(int pos) {
for (int i = 0; i < getChildCount(); i++) {
View view = getChildAt(i);
if (view instanceof TextView) {
((TextView)view).setTextColor(默認(rèn)顏色);
if (i == pos)
((TextView)view).setTextColor(高亮顏色);
2016-05-10
1.滑動到所有子view的倒數(shù)第2個時,整個ViewPagerIndicator的view不需要移動了,只需要移動三角指針就行了,所以
if ((position >= (mTabVisibleCount - 2)) && position < getChildCount() - 2 && offset > 0 && getChildCount() > mTabVisibleCount) {
……
this.scrollTo();
2.三角指針的mTranslationX一直在變大,它為什么沒動?
其實它動了,沒動的話怎么跑到下一個tab下面了呢?呵呵,你懂的。。。
if ((position >= (mTabVisibleCount - 2)) && position < getChildCount() - 2 && offset > 0 && getChildCount() > mTabVisibleCount) {
……
this.scrollTo();
2.三角指針的mTranslationX一直在變大,它為什么沒動?
其實它動了,沒動的話怎么跑到下一個tab下面了呢?呵呵,你懂的。。。
2016-05-09
1.滑動到所有子view的倒數(shù)第2個時,整個ViewPagerIndicator的view不需要移動了,只需要移動三角指針就行了,所以
if ((position >= (mTabVisibleCount - 2)) && position < getChildCount() - 2 && offset > 0 && getChildCount() > mTabVisibleCount) {
……
this.scrollTo();
2.三角指針的mTranslationX一直在變大,它為什么沒動?
其實它動了,沒動的話怎么跑到下一個tab下面了呢?呵呵,你懂的。。。
if ((position >= (mTabVisibleCount - 2)) && position < getChildCount() - 2 && offset > 0 && getChildCount() > mTabVisibleCount) {
……
this.scrollTo();
2.三角指針的mTranslationX一直在變大,它為什么沒動?
其實它動了,沒動的話怎么跑到下一個tab下面了呢?呵呵,你懂的。。。
2016-05-09