iOS Question Declare arrays of views in the designer [closed]

Discussion in 'iOS Questions' started by Didier9, Jun 28, 2018.

  1. Didier9

    Didier9 Active Member Licensed User

    I need help doing this, if it is possible.
    Some of my apps deal with arrays of views to facilitate processing. Erel strongly suggests using the Designer to declare views (rather than declaring in code) but I have not found a way or an example for how to do that.
    TIA
     
  2. klaus

    klaus Expert Licensed User

    Code:
    Private Labels(), Label1, Label2, Label3, Label4 As Label
    Labels = 
    Array As Label (Label1, Label2, Label3, Label4)
    Label1 to Label4 are the views defined in the Designer.
     
  3. Didier9

    Didier9 Active Member Licensed User

    Thank you klaus, but the point is that the number of views may vary (at least the number of views per page may vary, I may place more views per page on an iPad than on an iPhone, and have more pages on the iPhone), so I guess I would have to declare the maximum number of views I will ever use in the designer, and only use those I need. It does not seem very elegant. In code, you can just create the number you need without having to know at design time how many that is.

    Another possibility would be to create a scrolling page so that the number of views per page is not limited to the physical size of the screen.
    I have not done that so that would be new territory for me.

    Thanks again, I consider this closed.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice