Thursday, August 27, 2015

当你的getHeight() 获取不到组件的高度的时候?

TypedValue tv = new TypedValue();if (getActivity().getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
{
    actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());    params.setMargins(0, actionBarHeight,0,0);}

No comments:

Post a Comment