add editexts and listView in scrollView

gapi

Active Member
Licensed User
Longtime User
Hi all, I've a scrollView with N addView(control) ... at end of this list I want to add a ListView with this line:
B4X:
Panel1.AddView(myListView,5dip, 340dip, 100%x, 100%y)

...but I see only a few dip the listview, the rest is not visible, why?

complete code:
B4X:
Sub fillScroll_TestataOrdine()
 
 Dim Panel1 As Panel
 
    scvMain.Panel.Height = 800dip
   Panel0 = scvMain.Panel
   
 Dim bgnd As ColorDrawable
 bgnd.Initialize(Colors.Black, 5dip)
 
 Dim queryTestata As String
 Dim crsTestata As Cursor      
       
 Dim lblDestMerci, lblCodPagamento, lblTrasporto As Label
 Dim lblScontoCassa, lblData, lblNote As Label 
   
   lblData.Initialize("")
   lblData.Text = "Data dell'ordine"
   
   
   lblDestMerci.Initialize("")
   lblDestMerci.Text = "Destinazione merce"
   lblCodPagamento.Initialize("")
   lblCodPagamento.Text = "Pagamento"
   lblScontoCassa.Initialize("")
   lblScontoCassa.Text ="Sconto cassa"
   lblTrasporto.Initialize("")
   lblTrasporto.Text = "Trasporto"
   lblNote.Initialize("")
   lblNote.Text = "Note"
   txtDataTestata.Initialize("txtDataTestata")
   txtNoteTestata.Initialize("txtNoteTestata")
   txtScontoCassa.Initialize("txtScontoCassa")
   
   
   If(showOrdiniStep1.Ordine_Testata_Scelto==0) Then
      ' inizializzo la data all'avvio
       DataOdierna = DateTime.Now
       DateTime.DateFormat = "dd/MM/yyyy"
       txtDataTestata.Text= DateTime.Date(DataOdierna)   
      popolaSpinnerDestinazioneMerci
      popolaSpinnerCodicePagamento
      popolaSpinnerTrasporto
      
   Else
      
      queryTestata = "SELECT * FROM ord_tes WHERE id =" & showOrdiniStep1.Ordine_Testata_Scelto
      crsTestata = Main.SQL_Ordini.ExecQuery(queryTestata)
      
      For i = 0 To crsTestata.RowCount - 1
           crsTestata.Position = i
         Log("DATA =" & crsTestata.GetString("data"))
         Log("ScontoCassa =" & crsTestata.GetString("scCassa"))
         Log("Note =" & crsTestata.GetString("note"))
         txtDataTestata.Text = crsTestata.GetString("data") & ""
         txtScontoCassa.Text = crsTestata.GetString("scCassa") & ""
         txtNoteTestata.Text = crsTestata.GetString("note") & ""
      Next
      popolaSpinnerDestinazioneMerci
      popolaSpinnerCodicePagamento
      popolaSpinnerTrasporto
      
      
   End If   
   
   Panel1.Initialize("")
   
   
    Panel1.AddView(lblData, 10dip, 10dip, 80%x, 20dip)
   Panel1.AddView(txtDataTestata, 10dip, 35dip, 80%x, 50dip) ' Data Ordine
   Panel1.AddView(lblDestMerci, 10dip, 85dip, 80%x, 20dip)
   Panel1.AddView(spinDestMerci, 10dip, 105dip, 80%x, 50dip) ' Destinazione merci
   Panel1.AddView(lblCodPagamento, 10dip, 155dip, 80%x, 20dip)
   Panel1.AddView(spinCodPagamento, 10dip, 175dip, 80%x, 50dip) ' Pagamento
   Panel1.AddView(lblScontoCassa, 10dip, 225dip, 80%x, 20dip)
   Panel1.AddView(txtScontoCassa, 10dip, 245dip, 80%x, 50dip) ' Sconto Cassa
   Panel1.AddView(lblTrasporto, 10dip, 295dip, 80%x, 20dip)
   Panel1.AddView(SpinTrasporto, 10dip, 315dip, 80%x, 50dip) ' Trasporto
   Panel1.AddView(lblNote, 10dip, 365dip, 80%x, 20dip)
   Panel1.AddView(txtNoteTestata, 10dip, 385dip, 80%x, 50dip) ' Note
      
      popolaListView_OrdiniDettagli 'lv_Ordini_dettagli
      
      Panel1.AddView(lv_Ordini_dettagli,5dip, 340dip, 100%x, 100%y)
      
      
      
   Panel0.AddView(Panel1,1dip,1dip, 98%x, 100%y)   
End Sub

thanks
 

gapi

Active Member
Licensed User
Longtime User
seem solved :) I removed the panel0... but the listView is limited to scroll width ! If I want indipendent listview to end of view ?
 
Last edited:
Upvote 0

gapi

Active Member
Licensed User
Longtime User
how can I get a list of fields, then under a listview, without designer ... anyone?
tnx
 

Attachments

  • scroll_sample.jpg
    scroll_sample.jpg
    24.2 KB · Views: 305
Last edited:
Upvote 0
Top