I need to add a different color for every tabs.
For Eg: like this below image
MainActivity.java:
// Add New Tab
actionBar.addTab(actionBar.newTab().setText("Home")
.setTabListener(tabListener));
actionBar.addTab(actionBar.newTab().setText("News")
.setTabListener(tabListener));
actionBar.addTab(actionBar.newTab().setText("Latest")
.setTabListener(tabListener));
Home.java:
public class Home extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater
.inflate(R.layout.fragment_home, container, false);
((TextView) v.findViewById(R.id.textView)).setText("Home");
return v;
}
}
styles.xml:
<resources>
<style name="AppBaseTheme" parent="android:Theme.Light">
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
</style>
</resources>
Right now I am created the three tabs.Now I need to add a different color for each tab separately.I need some suggestion regarding to this.Thank you.