Layout params of loaded view are ignored

后端 未结 3 2016
滥情空心
滥情空心 2020-12-08 09:44

I\'m trying to write my own custom View and I have problem with LayoutParams.

The idea is to extend ViewGroup (LinearLa

3条回答
  •  悲哀的现实
    2020-12-08 10:19

    In Android "layout_" parameters refer to the the way the current View behaves in its parent layout. In this case, its parent is ll, but we can't see what that is.

    As for the layout of the TextView inside the LinearLayout, since the LinearLayout is vertical, all its children automatically have their layout_height overridden by "wrap_content" so that they can be laid out one beneath the other properly.

    So now the question is, what do you actually see and what do you want to see?

提交回复
热议问题