How to change default color to Tab Host
-
I am using 2.2 SDK version. and i used TabHost to display the activity in tab view format. when i install application in mobile phone(Version 2.2.1), the tab host color has been changed into yellow color. Even i dint give any color to TabHost. i dont know why the color has been changed. The same application when i run in emulator, it displays default color(ie) gray and black. can anyone faced and solved this issue pls guide me. Here the code ` mTabHost.addTab(mTabHost.newTabSpec("one").setIndicator("classA").setContent(new Intent(this, classA.class))); mTabHost.addTab(mTabHost.newTabSpec("two").setIndicator("classB").setContent(new Intent(this, classB.class))); mTabHost.addTab(mTabHost.newTabSpec("three").setIndicator("classC").setContent(new Intent(this, classc.class)));`
-
Answer:
In default android tab bar color will be in Grey, you can easily change the color of the tab bar. Use the below line of code to change the color of Tab tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.RED); or tabHost.getTabWidget().getChildAt(0).setBackgroundColor(Color.parseColor("#4E4E9C")); For further Reference you can refer http://www.androidpeople.com/android-tabhost-tutorial-%E2%80%93-part-2. If you are looking for iphonish Tabs you can refer this http://bakhtiyor.com/2009/10/iphonish-tabs/
HariRam at Stack Overflow Visit the source
Other answers
Change the min sdk version to 5.
niluka
Related Q & A:
- How to change default font?Best solution by Super User
- How to change background color in Android application?Best solution by Stack Overflow
- How to change the Color of each tab indicator?Best solution by Stack Overflow
- How to change the color of the white table in default layout?Best solution by Yahoo! Answers
- How to set default color for printer?Best solution by wiki.answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.