iOS Question Problems with placement of programmatically added views

Discussion in 'iOS Questions' started by Jack Cole, Mar 16, 2015.

  1. Jack Cole

    Jack Cole Active Member Licensed User

    ***ADMIN - PLEASE DELETE THIS POST***

    I'm having a lot of trouble with placement of programmatically added views. It may be some misunderstanding that I have in comparing to B4A. I have attached a simple example.

    In the following example, I programmatically add a scrollview, and a grid of 6x6 of imageviews. The imageviews should have 15dip of space in between, but the result is one big square with no spacing between.

    I haven't attached an example for other problems, but there seems to be something unusual and inconsistent about adding a layout and then trying to add additional views programmatically.

    Here is the code for adding the scrollview and grid.

    Code:
    Sub AddViews
        sv.Initialize(
    "sv",1000,1000)
        Page1.RootPanel.AddView(sv,
    0,90dip,100%x-90dip,100%y-90dip)
        
    For x=0 To 5
            
    For y=0 To 5
                
    Dim img As ImageView
                img.Initialize(
    "")
                img.Color=
    Colors.Black
                sv.Panel.AddView(img,x*
    50dip+15dip,y*50dip+15dip,50dip,50dip)
            
    Next
        
    Next
    End Sub
     

    Attached Files:

    Last edited: Mar 17, 2015
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