2014년 12월 6일 토요일

listview and posting the description - problem

I have a problem
I make a list of names with "listview". I can arrange a list of names (Listview) but ...
I want to when you click the names from the list appeared, along with the text description of the list. please help



Maybe this will help: http://appinventor.mit.edu/explore/ai2/quizme.html
Maybe you could post a screenshot of the blocks you tried. Where do you keep the descriptions? And how do you correlate the descriptions with the list items?



You will need to use the when ListView.AfterPicking block  in conjunction with a Control  If..then..else statement to tell the program that you want to see the text associated with the name you click.

What have you tried?       The text would probably display in a Label control, under, above or next to the ListView.   This would work similar to working with a ListPicker.    However, here you will have to write some code to tell the app what was selected and then what to do using a Selection block or the SelectionIndex.



it looks like this
I want to click the date from the list displayed a description
I am a beginner, please bear with us




 I can arrange a list of names (Listview) but ...I want to when you click the names from the list appeared, along with the text description of the list.

you do not need  multiple if then elseif blocks, instead use 2 lists: a list to display in the listview and a second list with the descriptions, then in the listview.AfterPicking event you can get the corresponding description like this

set label1.text to select list item (listDescription, listview.selectionindex)



You select as Taifun recommends (great advice if you have LOTS of choices).    You have only 5 ?     If that is true, you can select like this:

using the IF statements.    The IF statements area tool to use.   If you have relatively few choices in your picker, they are simple.

Use the blue box to set up several more  else if statements (the other four required); use ListPicker1.SelectionIndex  set it equal to 1 for the first, 2 for the second additional statements.

Selecting like this might be easier for a beginner to understand.  

You can try both ways.    Try some blocks.   You probably will get this right, but if not, ask again and post an image.  Good luck.



ok, about work, so maybe even make an image to the list:-)
or maybe it is possible to change the background color from bla
ck to white and font color from white to black?




The answer is no and yes. But you could have easily found out for yourself by looking at the documentation: http://ai2.appinventor.mit.edu/reference/components/userinterface.html#ListView
If you want further replies from us, then we would appreciate that you show that you have invested time and effort to find out.



Of course I appreciate it ... it will be my great pleasure



yes, you can have images in the list, see here 
and yes, you can change the background color with AppToMarket



댓글 없음:

댓글 쓰기