¡@

Home 

2014/10/16 ¤W¤È 08:18:50

android Programming Glossary: mboundedheight

Setting a maximum width on a ViewGroup

http://stackoverflow.com/questions/5875877/setting-a-maximum-width-on-a-viewgroup

For example public class BoundedLinearLayout extends LinearLayout private final int mBoundedWidth private final int mBoundedHeight public BoundedLinearLayout Context context super context mBoundedWidth 0 mBoundedHeight 0 public BoundedLinearLayout Context.. private final int mBoundedHeight public BoundedLinearLayout Context context super context mBoundedWidth 0 mBoundedHeight 0 public BoundedLinearLayout Context context AttributeSet attrs super context attrs TypedArray a getContext .obtainStyledAttributes.. attrs R.styleable.BoundedView mBoundedWidth a.getDimensionPixelSize R.styleable.BoundedView_bounded_width 0 mBoundedHeight a.getDimensionPixelSize R.styleable.BoundedView_bounded_height 0 a.recycle @Override protected void onMeasure int widthMeasureSpec..