Closed luyuan11233 closed 4 years ago
help
help
我的解决方案,亲测有效:
this is my resolve,work right:
tabLayout.setCustomTabView(new SmartTabLayout.TabProvider() {
@Override
public View createTabView(ViewGroup container, int position, PagerAdapter adapter) {
LinearLayout.LayoutParams lp = new LayoutParams(MATCH_PARENT,MATCH_PARENT);
tab1View.setLayoutParams(lp);
return tab1View;
}
});
help
i help you. 你是中国人吗
@makecloud 是啊,诸葛军师...
if (distributeEvenly) { LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) tabView.getLayoutParams(); lp.width = 0; lp.weight = 1; }
when "distributeEvenly" is true,"tabView.getLayoutParams()" get null,the answer is before "tabView.getLayoutParams()",you should set " tabStrip.addView(tabView);"