Author Topic: UITable children paddings and HTML/CSS box concept.  (Read 4101 times)

favoyang

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 14
    • View Profile
UITable children paddings and HTML/CSS box concept.
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable children paddings and HTML/CSS box concept.
« Reply #1 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.

PhilipC

  • Guest
Re: UITable children paddings and HTML/CSS box concept.
« Reply #2 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)?

favoyang

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: UITable children paddings and HTML/CSS box concept.
« Reply #3 on: July 27, 2012, 11:41:21 PM »
Yes, padding only for specific rows.