接著最后一個tab不出現(xiàn)問題,對if的判斷改個順序即可對不同mTabVisibleCount的數(shù)量進行匹配
if (position>=(mTabVisibleCount-2)&&positionOffset>0
&&getChildCount()>mTabVisibleCount)
{ if (mTabVisibleCount!=1&&(position!=getChildCount()-2))
{}
if (mTabVisibleCount==1){ } }
if (position>=(mTabVisibleCount-2)&&positionOffset>0
&&getChildCount()>mTabVisibleCount)
{ if (mTabVisibleCount!=1&&(position!=getChildCount()-2))
{}
if (mTabVisibleCount==1){ } }
2018-07-13
設(shè)置默認顯示個數(shù)的判斷應(yīng)該是小于等于0 不然設(shè)置visible_tab_count="0"會有錯誤
if (mTabVisibleCount<=0){
mTabVisibleCount = COUNT_DEFAULT_TAB;
}
if (mTabVisibleCount<=0){
mTabVisibleCount = COUNT_DEFAULT_TAB;
}
2018-05-04
好贊哦,思路之清晰啊,代碼好精練?。?!最主要的是學(xué)會了接口回調(diào)。這種tab菜單用的地方確實很多,以后都可以拿來復(fù)用了,加快了開發(fā)效率,通過學(xué)習(xí)也更好的了解的LinearLayout一些相關(guān)的方法
2017-07-05