iOS Question Cannot show another date picker

cirollo

Active Member
Licensed User
Longtime User
Hi guys!

I'm having a problem with this class, I've added both the anotherdatepicker class module and dateutils code module.

I've put this:

B4X:
Public Sub Show
   
   If Page2.IsInitialized = False Then
       Page2.Initialize("Page2")
       Page2.RootPanel.LoadLayout("Studenti")
       Page2.Title = "Elenco Alunni"
       
       USERWEB = Main.USERWEB.Trim
       PWDUWEB = Main.PWDUWEB.trim
       DBNAME = Main.DBNAME.trim
       CODANNSC = Main.CODANNSC.trim
       
       'azzeriamo la variabile per evitare di attivare i pulsanti
       CodiceSel="XXXX"
       
       'sistemo sulla form gli elementi
       LblStudenti.Top=10
       LblStudenti.Left=20
       '
       PckStudenti.Top=60
       PckStudenti.Left=20
       '
       Dim deadline As Int
       deadline=0
       deadline=(PckStudenti.Top+PckStudenti.Height)
       deadline=PckStudenti.top+80dip
       '
       LblStuSel.Initialize(LblStuSel)
       LblStuSel.Top=(deadline-30)
       LblStuSel.Left=20
       '
       Pnl1.Top=(deadline+40)
       Pnl1.Left=20
   '   Pnl1.Width=Activity.Width-40
       '
       LblNominativo.Top=(Pnl1.Top+20)
       LblNominativo.Left=40
       '
       LblDesNominativo.Top=(LblNominativo.Top+60)
       LblDesNominativo.Left=40
       LblDesNominativo.Visible=False
       '
       LblScuola.Top=(LblDesNominativo.Top+80)
       LblScuola.Left=40
       '
       LblDesScuola.Top=(LblScuola.Top+60)
       LblDesScuola.Left=40
       LblDesScuola.Visible=False
       '
       LblClasse.Top=(LblDesScuola.Top+80)
       LblClasse.Left=40
       '
       LblDesClasse.Top=(LblClasse.Top+60)
       LblDesClasse.Left=40
       LblDesClasse.Visible=False
       '
       LblSezione.Top=(LblDesScuola.Top+80)
       LblSezione.Left=220
       '
       LblDesSezione.Top=(LblSezione.Top+60)
       LblDesSezione.Left=220
       LblDesSezione.Visible=False
       '
       LblDieta.Top=(LblDesScuola.Top+80)
       LblDieta.Left=440
       '
       LblDesDieta.Top=(LblSezione.Top+60)
       LblDesDieta.Left=440
       LblDesDieta.Visible=False
       '
       LblSaldo.Top=(LblDesClasse.Top+150)
       LblSaldo.Left=40
       '
       LblDesSaldo.Top=(LblSaldo.Top+60)
       LblDesSaldo.Left=40
       LblDesSaldo.Visible=False
       '
   '   BtnPresenze.Top=Activity.Height-310
   '   BtnPresenze.Left=(Activity.Width/2-172dip)
   '   
   '   '
   '   BtnMenu.Top=Activity.Height-310
   '   BtnMenu.Left=(Activity.Width/2-86dip)
   '   '
   '   BtnRicarica.Top=Activity.Height-310
   '   BtnRicarica.Left=(Activity.Width/2+5dip)
   '   '
   '   BtnAssenza.Top=Activity.Height-310 'spstudenti
   '   BtnAssenza.Left=(Activity.Width/2+91dip)
       
       'disabilito i bottoni se non scelgo alunno
       BtnPresenze.Enabled=False
       BtnMenu.Enabled=False
   '   BtnMail.Enabled=False
       BtnRicarica.Enabled=False
       BtnAssenza.Enabled=False
   End If
   Main.NavControl.ShowPage(Page2)
   
   CaricaAlunni

End Sub

Sub Page_Resize(Width As Float, Height As Float)
   If Not(adp.IsInitialized) Then
       adp.Initialize(Me, "adp")
       adp.AddToParent(Page2.RootPanel, BtnPresenze)
       adp.SetDate(DateTime.Now, True)
   End If
End Sub

in the click event of a button I've this:

B4X:
Sub BtnPresenze_Click
   Log("calendario")
   adp.Show
End Sub

I see the string "calendario" in the log but the datepicker won't appear.... why?
 

cirollo

Active Member
Licensed User
Longtime User
mainly because I've used it in B4A (and a bit customized too) and I wanted to add the same functionalities in ios
 
Upvote 0
Top