This code populate a listview( from ListView example).
'-------------------------------------------------------------------
ListView1.Initialize("ListView1")
Dim GD As GradientDrawable
GD.Initialize("TR_BL", Array As Int(Colors.Gray, Colors.LightGray))
Activity.Background = GD
ListView1.ScrollingBackgroundColor = Colors.Transparent
Dim Bitmap1 As Bitmap
Bitmap1.Initialize(File.DirAssets, "button.gif")
ListView1.SingleLineLayout.ItemHeight = 100dip
ListView1.SingleLineLayout.Label.TextSize = 20
ListView1.SingleLineLayout.Label.TextColor = Colors.Blue
ListView1.SingleLineLayout.Label.Gravity = Gravity.CENTER
ListView1.FastScrollEnabled = True
For i = 1 To 500
ListView1.AddSingleLine("Item #" & i & "
12345678901234567890123456789012345678901234567890")
ListView1.AddTwoLines( "Item #" & i & "
12345678901234567890123456789012345678901234567890" , "This is the second
line.")
ListView1.AddTwoLinesAndBitmap("Item #" & i & "
12345678901234567890123456789012345678901234567890" , "This is the second
line with bmp.", Bitmap1)
Next
Activity.AddView( ListView1, 0, 0, 100%x, 100%y)
'-------------------------------------------------------------------
The display in landscape format ( fig.1.jpg) is correct but not in portrait
format ( fig.2.jpb).
Can you help me?
'-------------------------------------------------------------------
ListView1.Initialize("ListView1")
Dim GD As GradientDrawable
GD.Initialize("TR_BL", Array As Int(Colors.Gray, Colors.LightGray))
Activity.Background = GD
ListView1.ScrollingBackgroundColor = Colors.Transparent
Dim Bitmap1 As Bitmap
Bitmap1.Initialize(File.DirAssets, "button.gif")
ListView1.SingleLineLayout.ItemHeight = 100dip
ListView1.SingleLineLayout.Label.TextSize = 20
ListView1.SingleLineLayout.Label.TextColor = Colors.Blue
ListView1.SingleLineLayout.Label.Gravity = Gravity.CENTER
ListView1.FastScrollEnabled = True
For i = 1 To 500
ListView1.AddSingleLine("Item #" & i & "
12345678901234567890123456789012345678901234567890")
ListView1.AddTwoLines( "Item #" & i & "
12345678901234567890123456789012345678901234567890" , "This is the second
line.")
ListView1.AddTwoLinesAndBitmap("Item #" & i & "
12345678901234567890123456789012345678901234567890" , "This is the second
line with bmp.", Bitmap1)
Next
Activity.AddView( ListView1, 0, 0, 100%x, 100%y)
'-------------------------------------------------------------------
The display in landscape format ( fig.1.jpg) is correct but not in portrait
format ( fig.2.jpb).
Can you help me?