Hi,
I want to use a spinner in a customDialog. It works fine except when I want to disable it. Setting enabled to false changes nothing.
On the other hand, setting visible to false makes the spinner invisible.
To check that the error wasn't in my code, I went back to the example [B4X] XUI Views - Cross platform views and dialogs
In the layout CustomDialog, I added a view SpinnerName.
In the code
and
The SpinnerName is displayed and stil active.
But if I remove the comment on the visibility line, SpinnerName is rendered invisible.
Why doesn't enabled/disabled work, whereas visible/invisible does?
Thanks for your answers
I want to use a spinner in a customDialog. It works fine except when I want to disable it. Setting enabled to false changes nothing.
On the other hand, setting visible to false makes the spinner invisible.
To check that the error wasn't in my code, I went back to the example [B4X] XUI Views - Cross platform views and dialogs
In the layout CustomDialog, I added a view SpinnerName.
In the code
B4X:
Sub Globals
Private dialog As B4XDialog
Private fieldFirstName As B4XFloatTextField
Private fieldLastName As B4XFloatTextField
Private SpinnerName As Spinner
End Sub
B4X:
Sub btnCustom_Click
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 300dip, 200dip)
p.LoadLayout("CustomDialog")
SpinnerName.Add("Value1")
SpinnerName.Add("Value2")
SpinnerName.Add("Value3")
SpinnerName.Enabled = False
' SpinnerName.Visible = False
dialog.PutAtTop = True 'put the dialog at the top of the screen
Wait For (dialog.ShowCustom(p, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
xui.MsgboxAsync(SpinnerName.SelectedItem & " " & fieldFirstName.Text & " " & fieldLastName.Text, "Result")
End If
End Sub
The SpinnerName is displayed and stil active.
But if I remove the comment on the visibility line, SpinnerName is rendered invisible.
Why doesn't enabled/disabled work, whereas visible/invisible does?
Thanks for your answers