質問

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...

役に立ちましたか?

解決

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);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top