i am creating an app on woman safety.. it has a menu button through which we can select whatever is needed(the button opens the spinner).. the problem that im facing is :- whenever i select anything from spinner it doesn't open it ... then when i again click on the button it opens.. and its very odd behavior which was not expected
Show the relevant blocks.
i think u must be having my aia file.. u can see from the companion or app it will make you understand my problem better
move your if statement into the AfterSelecting event, see also the documentation User Interface
also you might want to do some tutorials to learn the basics... it seems to be, there is a lack of understanding, how everything works...
also see tip 1 here
A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles
How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .
your code is probably wrong @Neelam_Singhal . The Spinner works properly. How you use the Spinner.DisplayDropdown is possibly the issue.
Use a 'Selection' option for the first spinner item to avoid issues known to be part of the Spinner design. The Selection will be part of the Spinner Menu but will not do anything other than force a user to select one of the other items, triggering an event.
@SteveJG i tried this out still i'm getting the same results.. its not even opening once
The code I originally posted works fine with virtual screen. I tested it with Screens and you are correct, it does not elicit the Screen change.
However, this modified example does actually change screens. See modifications in Button2.Click and Screen1.Initialize .
Try it. Does the code work for you. It works on my Tablet.
i will surely do
what is that label for?
unfortunately it is again not working
whatever you want it to be for. I use it in my demo.
It works, just not the way you use it. What exactly is not happening that you expect to happen?
The example switches Screens based on a Spinner selection. You app does not.
Here is an example aia working on an 8.1 tablet. What seems to be different from your example is this example has a Visible Spinner object on the screen that calls the Spinner. That may be necessary for the Spinner.DropDown block to work or for the Spinner to work at all. A guess is the Spinner.visible must be true to allow the switching of Screens. You don't have that in your app but the example does.
SpinnerBasic3.aia (5.2 KB)
OK Thanks SteveJG
in this way also i am able to switch screens correctly
thanks @SteveJG for helping me solve
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.