Author Topic: Feature suggestion: UIResponsive  (Read 3995 times)

Edy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Feature suggestion: UIResponsive
« on: May 30, 2014, 02:53:55 AM »
While I was documenting NGUI in spanish I toyed with the UIGrid and UITable components, as well as the TweenWidth/TweenHeight components. Then I realized that it would be really cool to have a component that implements a grid-based responsive design in the way that the Bootstrap CSS template does:

Bootstrap 2 doc (easier to understand)
Bootstrap 3 doc (latest version, harder to see if you're not familiarized with CSS

With NGUI, it would be cool to have a widget "UIResponsive" (similar to UITable/UIGrid) that divides the widget's area in a number of horizontal cells. Each children widget specifies how many grids spans/offsets horizontally. Each children receives its size automatically depending on the parent's size, allowing them to be located side by side.

For instance, imagine a parent UIResponsive component configured to spawn 12 cells (Bootstrap default). Two children widgets configured to take 6 cells each would be placed side by side each one taking the 50% of the width of the parent.

When the parent's width is smaller than a configured limit, then all children are given a full "row" as width (100% of width of the parent), and stacked vertically.

Such "UIResponsive" component wouldn't be difficult to implement and would provide a new world of possibilities for NGUI and dynamic layouts, for instance between portrait/landscape in mobile.

Edy

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Feature suggestion: UIResponsive
« Reply #1 on: May 30, 2014, 02:26:13 PM »
Both Grid and Table components are due for a re-design at some point soon.