Android issue: ViewFilpper height issue

Found use, the height or particular dp set match_parent value, there are problems.
Later print the log its outer Layout, itself and its interior height TextView: After two highly consistent, smaller than the outermost layer of the layout.
So ViewFlipper height is the height of the decision by the view, the currently visible child inside of.

Example:
outer high Layout 25 dp,
ViewFlipper high wrap_content,
internal codes provided by TextView became 25 dp 25 dp course also inflate a high TextView

LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT,
                    (int) TypedValue.applyDimension(
                    TypedValue.COMPLEX_UNIT_DIP, 25, getContext().getResources().getDisplayMetrics()));
viewFlipper.addView(textView, lp);
Published 400 original articles · won praise 364 · Views 1.62 million +

Guess you like

Origin blog.csdn.net/jjwwmlp456/article/details/90599290
Recommended