Closed iAviatorJose closed 8 years ago
Hi, @iAviatorJose
Yes, you can if you use TabProvider. TabProvider can build your own layout in the tab :+1:
SmartTabLayout#setCustomTabView(TabProvider provider)
Solved?
Use createTabView to use any kind of layout for your tab layout. In "smart_tab_icons_and_text", you can use text, Icons, spinner etc whatever you want.
@Override public View createTabView(ViewGroup container, int position, PagerAdapter adapter) {
View itemView = layoutInflater.inflate(R.layout.smart_tab_icons_and_text, container, false);
TextView text = (TextView) itemView.findViewById(R.id.custom_tab_text);
ImageView icon = (ImageView) itemView.findViewById(R.id.custom_tab_icon);
switch (position) {
default:
throw new IllegalStateException("Invalid position: " + position);
}
return itemView;
}
});
For a long time, there is no response. So, we will close the issue.
Is there anyway to have tabs with title as well as Image ??