1 How do I set the color of the Actionbar tab?
Set the color of the Actionbar
drawable draw = new colordrawable (color.green);
Actionbar.setbackgrounddrawable (Draw);
Draw = new Colordrawable (color.green);
// Set Tab color
Actionbar.setstackedbackgrounddrawable (Draw);
2 How do I set the font center for Actionbar?
Custom view!
// Set Custom display: Center font:
Actionbar.setdisplayshowcustomenabled (TRUE);
Actionbar.setcustomview (R.layout.actionbar_coustom_menu);
Layout file:
<?xml version= "1.0" encoding= "Utf-8"?>
<framelayout xmlns:android= "Http://schemas.android.com/apk/res/android"
android:layout_gravity= "Center"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content" >
<textview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:textsize= "20SP"
android:text= "Mall"
/>
</FrameLayout>
3//Do not show title
Actionbar.setdisplayshowtitleenabled (FALSE);
、
4 Add ListView Item
Ok
5 10-12 16:45:06.501:e/androidruntime (18541): Java.lang.UnsupportedOperationException:addView (View, Layoutparams) Is isn't supported in Adapterview
Solution:
The last parameter is modified to: null
Convertview = view.inflate (context, r.layout.fragment_shop_listview_item, null);
Android----------Android Bar Bug summary