2014년 11월 30일 일요일

dynamically setting the horizontal arrangement visibility

I'm not sure how to explain this..

I would like to run through a 'for each' block. During that block I would like to use a number to refer to a vertical arrangement to make it either visible or not visible.
Does anyone know how I set the vertical arrangement.visible component dynamically. i.e. first loop it might be vertical arrangement 2, next one 4 and so on. I have 50 so I don't want to name each one.



use the advanced blocks and put your arrangements into a list
see a similar example with buttons here

A Multiple Choice Quiz: How to work with the advanced features


btw. 50 vertical arrangements is a lot, I recommend you to build your app to test if it is buildable, because probably you are working close to the limit of App Inventor...

why do you need 50 vertical arrangements? there might be some redundancy in your blocks...



Thanks for your reply. I have just seen the 'Any Component' tab in the blocks. This is what I was looking for. I am nearly finished my app, which is a recruitment app. Everything seems OK so far. Why is 50 too many for Ai2? Is it a speed issue?
One of the last stages is to improve the link with the fusion table so that users don't need to agree to anything on first use and don't need a password. I have seen that you have some code to create a way round that so I will email you when the time comes.



50 arrangements seems extremely unnecessary and unreasonable Johnny... What could you possibly need that many for?  

As Taifun said above, you may have redundancy in your arrangements and blocks...  see the section in my tips on redundancy below:


댓글 없음:

댓글 쓰기