Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid custom layout manager - layout in children
    primarykey
    data
    text
    <p>I have created a custom layout manager derived from LinearLayout. (I do not really use much of LinearLayout functionality but I do not want to care about all of many ViewGroup abstract methods.) I have overwritten only</p> <pre><code>protected void onLayout(boolean changed, int l, int t, int r, int b) </code></pre> <p>method and I call child.layout(...) in MyLayout.onLayout(...) for each of its children. All other stuff is original LinearLayout. It will work fine and children will be placed correctly in their parent MyLayout if the children are simple controlls without children (grandchildren of the MyLayout).</p> <p>Problems come when I use some ViewGroup (LinearLayout, ViewSwitcher, ...) with children as child of MyLayout. In this case children (of MyLayout) are placed well but grandchildren (of MyLayout) inside of each child not. It seems paramaters and values like wrap_content, fill_parent, layoutWeight are not handled correctly. For example ViewSwitcher in MyLayout does not show its content, LinearLayouts (child of MyLayout) children (grandchildren of MyLayout) with fill_parent have size of 0px, CompoundButton (child of MyLayout) sometimes does not show its text...</p> <p>It seems child.layout(...) in MyLayout.onLayout sets the size and position of each child correctly but I need to call some other method to make layout in each child working well (if the child is ViewGroup with children). Is there something like that or MyLayout with just changed onLayout should work well?</p> <p>Thanks for all advices.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload