Pregunta

I am using FragmentTabHost to implement bottom tabs with icon and label but following sentence shows only label

mTabHost.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple",getResources().getDrawable(R.drawable.ic_launcher)),
            Fragment1.class, b);

I also see somewhere following works properly

setIndicator(View);

but I don't know syntax to set custom view in setIndicator

plz help Thanks...

¿Fue útil?

Solución

I make custom view and set it as setIndicator(View v);

View chatView=LayoutInflater.from(this).inflate(R.layout.chat_icon,null);
    mTabHost.addTab(mTabHost.newTabSpec("simple").setIndicator(chatView),
            Fragment1.class, b);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top