Android Question TableView example - loading to Panel

Discussion in 'Android Questions' started by Arf, Mar 13, 2015.

  1. Arf

    Arf Active Member Licensed User

    I adapted Klaus's TableExample project
    http://www.b4x.com/android/forum/threads/gridline-in-tableview-using-scrollview.7684/#post-43670
    and took out the populate from CSV part, and use it to load results into a table. Seems to work, so I now need to display the table in a small portion of screen rather than full screen.

    I put a panel (TablePanel) in with the Designer and size this to a small area in the designer scripts.
    I put the scrollview (ResultsTabel) in the designer as a Child of TablePanel.
    Then in ActivityCreate I do the following:
    Code:
    TablePanel.AddView(ResultsTable,TablePanel.Left, TablePanel.Top, TablePanel.Width, TablePanel.Height)
    Some of the table is displayed, but not across the full width of the panel. Also, the header row seems to go up out of the panel for some reason.
    I will continue trying to fix it, but is my strategy generally correct to display the table? I was hoping for it to fill the entire panel I made.
     
  2. Arf

    Arf Active Member Licensed User

    It seems that when I load the table to a panel, the header is always drawn with reference to the Activity and not the panel.
    Here's a screenshot of the top bit of my screen in portait mode, the header is at 0,0 while the rest of the table is in the panel that was supposed to be home to it.

    [​IMG]
     
  3. Arf

    Arf Active Member Licensed User

    Nevermind, I found it. A, 'Activity.Addview' was still urking in the header drawing bit :)
     
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