Open hyvenzhu opened 7 years ago
stl_indicatorAlwaysInCenter doesn't work when you try to set data for tabs after some delay, for example, after some background task. This happens because onSizeChanged() in SmartTabLayout doesn't call again. You should invoke it directly with calling resize.
ViewGroup.LayoutParams params = tabs.getLayoutParams();
tabs.setLayoutParams(params);
call setLayoutParams for invoke onMeasure and onSizeChanged. this worked for me.
You may be want stl_titleOffset= 'auto_center'.
@Override protected void onCreate(Bundle savedInstanceState) { ...
}
while i do it like this, indicator is not in center.