<centertop> and auto height
#1
I have a list with height set to auto but I can't get <centertop> to work with it.

Code:
<!-- Main Menu list -->
<control type="list" id="9005">
    <left>8</left>
    <centertop>50%</centertop>
    <width>480</width>
    <height min="96" max="1080">auto</height>
    ....
    ....
    ....
</control>

I need the list to be centered vertically regardless of how many items it contains. I'm currently doing it with a number of animations to slide it a set amount depending on the number of items. But I thought auto height and <centertop> would make it much easier, however it doesn't seem to work. Any ideas?
Reply
#2
List controls can't take auto width/height.

Only textbox controls can take auto height.
Only button and label controls can take auto width.

The only way to do what you want is with a grouplist and individual groups for each item.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
Ok, so I assume that my
Code:
<height min="96" max="1080">auto</height>
is just using the max size of 1080 then?

As I said I've got it working using a set of slide animations to move it down depending on the number of items in the list, I was just hoping to simplify it if possible.

Thanks anyway.
Reply
#4
I'm not sure if it takes the max or if it just ignores the tag altogether (i.e. takes height of parent group instead).

Yeah slide animations or grouplist are the only way to go.

If you're basing slides on number of items, remember to use Container.NumAllItems as that includes the ".." parent folder item if it is enabled (whereas Container.NumItems ignores parent folder item).
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#5
After testing it does indeed use the max value.
 
(2020-04-27, 02:40)jurialmunkey Wrote: If you're basing slides on number of items, remember to use Container.NumAllItems as that includes the ".." parent folder item if it is enabled (whereas Container.NumItems ignores parent folder item).
Thanks for the tip.... My list is using static content but has items that can be turned off so has no parent item, but I'll keep that in mind if I need to use the method on a list that could have a parent item. Thanks.
Reply

Logout Mark Read Team Forum Stats Members Help
<centertop> and auto height0