Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: favoyang on July 26, 2012, 09:54:38 PM

Title: UITable children paddings and HTML/CSS box concept.
Post by: favoyang on July 26, 2012, 09:54:38 PM
I use UITable to layout a form like UI, so the row size can match the content size.

There's an issue for UILabel only rows, that I need some extra paddings. The workaround is that wrap the row with a dummy UISlicedSprite background object, which describes the row size. Then disable the UISlicedSprite component, so it's not get rendered. A bit complicated and if the UILabel size changed, I have to manually calculate UISlicedSprite size.

I wonder shall NGUI add a box concept like the one in HTML/CSS. So that each UI element have a padding concept and know it's actually size. Then UITable / UIAnchor can aware of that property.
Title: Re: UITable children paddings and HTML/CSS box concept.
Post by: ArenMook on July 27, 2012, 06:08:45 AM
I recall Phil did some work related to padding, but I'm not sure if it's relevant to this. I just remember it never made it to the repository. Perhaps he can fill you in when he wakes up.
Title: Re: UITable children paddings and HTML/CSS box concept.
Post by: PhilipC on July 27, 2012, 10:01:27 AM
Yea the padding work i did i dont think would be relevant to what you need (also was unable to get it working properly without a rewrite of the table). 

What you want is extra padding ONLY for some specific rows (i.e. rows with labels only)?
Title: Re: UITable children paddings and HTML/CSS box concept.
Post by: favoyang on July 27, 2012, 11:41:21 PM
Yes, padding only for specific rows.