iOS Question TableView problem

Claude Brun

Active Member
Licensed User
Longtime User
Hi,
When I load a tableview on a panel I can't see all the items by scrolling
I load 50 items, if I keep my finger on the screen I can see the last items, but when I lift my finger from the screen, you can only see up to 44


my code:
'Code module
#Region  Project Attributes
    #ApplicationLabel: TableView
    #Version: 1.0.0
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
    #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
    #iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
    #ATSEnabled: True
    #MinVersion: 11

#End Region

Sub Process_Globals
    Public App As Application
    Public NavControl As NavigationController
    Private Page1 As Page
    Private ptv As Panel
    Private tv As TableView
    Private TextField1 As TextField
End Sub

Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    Dim no As NativeObject = App
    NavControl.NavigationBarVisible = False
    Page1.Initialize("Page1")
    Page1.RootPanel.LoadLayout("Main")
    NavControl.ShowPage(Page1)
    tv.Initialize("tv", False)
    ptv.AddView(tv, 0, 0, 100%x, 100%y)
    tv.RowHeight = 30
    For i = 1 To 50
        Dim s As AttributedString
        Dim tc As TableCell = tv.AddSingleLine("")
        tc.ShowSelection = True
        s.Initialize("Note " & i, Font.CreateFontAwesome(14), Colors.Black)
        tc.Text = s
    Next
End Sub
 

Attachments

  • IMG_3468.PNG
    IMG_3468.PNG
    82.1 KB · Views: 51

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. I don't recommend using TableView. xCLV is cross platform and is easier to work with.
2. Creating the layout programmatically is a big mistake.
3. You can't use %x / %y outside of the resize event.
4. If you are building the layout programmatically then you must implement the resize event and resize the layout. Better to use the designer.
 
Upvote 0

Claude Brun

Active Member
Licensed User
Longtime User
ok, I looked at the Xclv example, but it doesn't meet my needs.
For the TableView I have to manage it in the code, TableView does not exist in designer.

Otherwise I used resize %y and it actually works well

THANKS
 
Upvote 0
Top