Android Question spinner performClick in andorid 4.x

giggetto71

Active Member
Licensed User
Longtime User
Hi,
I have used Erel suggestion given in

https://www.b4x.com/android/forum/threads/spinner-button-click.17195/

ie

Sub OpenSpinner(s AsSpinner)Dim r AsReflector
r.Target = s
r.RunMethod("performClick")
End Sub

to open the spinner upon clicking something (in my case a lable object).
In Android 3.x it works fine as the spinner opens the view with the radio button, but in 4.x it opens fine the spinner but spinner is placed in the top left corner (it looks 0,0) of the panel.
Actually is thew same behavior of the above post but that post does not give a final solution.
Is there a way to control the top left settings of the "target" view?
thanks!!
 

giggetto71

Active Member
Licensed User
Longtime User
Erel,
thanks, but I think I did not manage to explain my problem. my spinner is actually placed where the red Arrow points (top 23, left 250) and it is set visible = false. when the lable above the spinner (the lable is visible) is clicked I call the openspinner sub which in fact open the spinner but instead of opening as expected at top 23 and left 250, it opens where the blu Arrow points in the picture which I believe is 0,0 of the panel where the spinner is placed.

If I make the spinner visible at design time and the click on it it actually opons in the right place..but having the spinner visible would really make me redesign the UI...
thanks for your help
 

Attachments

  • picture.PNG
    picture.PNG
    117.7 KB · Views: 256
Upvote 0

RJB

Active Member
Licensed User
Longtime User
For what its worth, in case others have the problem:
I had the problem, in my case ensuring the spinner is visible before 'addview' and then adding 'doevents' after the 'addview' solved the issue

Menu.Visible = True
Activity.AddView(Menu, ......
DoEvents
openspinner(Menu)
 
Upvote 0
Top