Can we set background image to tabs' background in android?

Following code worked for me: tabHost.getTabWidget(). SetBackgroundResource(R.drawable. Tabhost_bg).

I manage to set background but my tabs are visible on top with grey colour... :( – Farhan Mar 21 at 11:07 You need to set view with transparent background (or w/o any) as an indicator to your tabs to make this solution work. – ernazm Oct 17 at 9:29.

Try this getTabHost(). AddTab(getTabHost(). NewTabSpec("A") //set the tab name .

SetIndicator("A") //Add additional flags to the intent (or with existing flags value). . SetContent(new Intent(this, A.

Class). AddFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP))); //for creating tab we need to pass tabSpec and tab name to setIndicator and pass intent to its //setContent to Tab Activity predefined method getTabHost then it will create tab getTabHost().

AddTab(getTabHost(). NewTabSpec("B") //set the tab name . SetIndicator("B") //Add additional flags to the intent (or with existing flags value).. SetContent(new Intent(this,B.

Class). AddFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP)) ); getTabHost().

AddTab(getTabHost(). NewTabSpec("C") //set the tab name . SetIndicator("C") //Add additional flags to the intent (or with existing flags value).. SetContent(new Intent(this,C.

Class). AddFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP)) ); getTabHost().getTabWidget().

GetChildAt(0). SetBackgroundResource(R.drawable. A); getTabHost().getTabWidget().

GetChildAt(1). SetBackgroundResource(R.drawable. B); getTabHost().getTabWidget().

GetChildAt(2). SetBackgroundResource(R.drawable. C).

TabSpec generalTab = mTabHost. NewTabSpec("general"); generalTab. SetIndicator("General", getResources().

GetDrawable(android.R.drawable. Ic_menu_preferences)). SetContent(R.id.

TabGeneral); I have used default android drawable you can use what you want for setting background of tabhost this. MTabHost = (TabHost)this. FindViewById(R.id.

TabHost); this.mTabHost. SetBackgroundResource(R.drawable. Back).

This will set image as background to individual tabs. I want to set background image to background of all the tabs part below the tabs. – neha Jan 21 at 7:46 edited my answer – ingsaurabh Jan 21 at 7:50 This' setting the background image to entire screen and not just background of tabs.

– neha Jan 21 at 8:11 actually what you wanted is done in this way only it will set the image to whole background but when you put different images in different tabs then this image is hided by tabs image this is the only workaround I know hope any other can have better answer for this – ingsaurabh Jan 21 at 8:19.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions