iOS Question Can I change height of items in iTableView?

Discussion in 'iOS Questions' started by Binary01, May 5, 2019.

  1. Binary01

    Binary01 Member Licensed User

    Hello,

    How can I change height of SingleLine and TwoLines in iTableViews ?

    In Listview of B4A I change its' heights as follow

    Code:
    listview1.TwoLinesAndBitmap.ItemHeight = 55dip
        listview1.TwoLinesAndBitmap.Label.Height = 
    30dip
        listview1.TwoLinesAndBitmap.SecondLabel.Height = 
    20dip
    My b4i tableview code is as follow:

    Code:
    Private Sub pg_Resize(Width As Int, Height As Int)
        TableView1.Initialize(
    "TableView1"False)
        pnSong.AddView(TableView1,
    0dip,0dip,100%x,100%y)

        
    Dim img As Bitmap = LoadBitmap(File.DirAssets, "icon.png")
        
    For i = 1 To 50
            TableView1.AddSingleLine(
    "Item #" & i)
     
            
    Dim tc As TableCell = TableView1.AddTwoLines("First Line""")
            tc.Bitmap = img
            tc.IndentationLevel =
    0
            
    Dim ColoredTitle As AttributedString
            ColoredTitle.Initialize(
    "second line "Font.CreateNew2("AK01",26), Colors.Black)
            tc.DetailText = ColoredTitle
        
    Next
    End Sub
    TableCell.CustomView may define its height. But I do not want to use it.

    Thanks
     

    Attached Files:

    Last edited: May 6, 2019
  2. Erel

    Erel Administrator Staff Member Licensed User

    Don't use iTableView. Use xCustomListView.
     
    Binary01 likes this.
  3. Binary01

    Binary01 Member Licensed User

    Thanks
     
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