找到你要的答案

Q:Problems with Listpicker App Inventor

Q:与listpicker App Inventor的问题

I'm a beginner at App Inventor and I don't know what I'm doing wrong with the listpicker. I am trying to create and app to reproduce the music I have stored in my server but when i display the listpicker I can't click any of the options and also I can't go back to the first screen. Here I put my code:

Image 1 enter image description here Image 2 enter image description here

I tried to remove the line that says call listpicker.open but it only made appear a totally black screen. The result of the code I just posted is exactly what I spect a list with the name and the link of the 2 songs I already upload to my server but when I click them it didn't do anything.

Thanks for your help.

I'm a beginner at App Inventor and I don't know what I'm doing wrong with the listpicker. I am trying to create and app to reproduce the music I have stored in my server but when i display the listpicker I can't click any of the options and also I can't go back to the first screen. Here I put my code:

Image 1 enter image description here Image 2 enter image description here

I tried to remove the line that says call listpicker.open but it only made appear a totally black screen. The result of the code I just posted is exactly what I spect a list with the name and the link of the 2 songs I already upload to my server but when I click them it didn't do anything.

谢谢你的帮助。

answer1: 回答1:

The Web component works asynchronously, which means, it takes a little bit, until the result is available. The result you will get in the Web.GotText event.

Therefore it does not make sense to call the updateListpicker procedure in the Listpicker.BeforePicking event, because the result still is not available and you get displayed an empty listpicker. The listpicker will be opened, before you have received the result!

Set the listpicker to visible=false and use a button.click event to call the updateListpicker procedure. Then as you already do it in the Web.GotText event, assign the received list to the listpicker and open it.

Web组件异步工作,这意味着,它需要一点,直到结果可用。结果你会在web.gottext事件。

因此它不在listpicker.beforepicking事件调用updatelistpicker程序意义,因为其结果仍然是不可用的,你可以显示一个空的listpicker。的listpicker将被打开,在你收到的结果!

设置listpicker可见=假和使用button.click事件调用updatelistpicker程序。当你已经做的web.gottext事件,到listpicker分配收到的列表并打开它。

android  app-inventor