These daysProgramIf you want to understand a problem, record it here.
Actionbarcustomview customview = new actionbarcustomview (context );
Actionbar. layoutparams Lp = new actionbar. layoutparams (
Layoutparams. match_parent, layoutparams. match_parent,
Gravity. center_vertical );
Customview. setlayoutparams (LP );
Add a sub-View to the actionbar. actionbarcustomview is a sub-view written by you.
WhereIf the parent control is actionbar, it must be written as actionbar. layoutparams.
If the parent control is linearlayout, it must be written as linearlayout. layoutparams.
Linearlayout. layoutparams = new linearlayout. layoutparams (
Layoutparams. match_parent, layoutparams. match_parent );
Layoutparams. Gravity = gravity. Center;
The child view layout should be based on the parent control. If your child layout is displayed by the parent layout, you must set it like this, otherwise, the Child view is incorrectly displayed in the parent view.
Generally, this problem will not be exposed. It will only appear when you use details.