2017년 4월 12일 수요일

dynamic creation of components


is it possible, with app inventor 2, to create dynamically a list of buttons, which can be called by a number ?

For exemple Button(i).Background etc ... where i is an integer ?

--
You cannot dynamically create components in AI2.  You can create them at Design-Time, and then make them invisible.  Make them visible as you need them.

--
OK. So it's not possible, I think, to create them with an integer index.

--
Right... create them, make them invisible, and you can use numbers to name them.  Then make them visible as you need them...

--
The last block in the palette for a button is the component block,
which can be added to a list of buttons at Screen1.Initialize time
and not before that.

The button components on that list an be addressed via list blocks,
and fed to Any Button blocks from the Any Component leg of the 
Blocks palette.

--

댓글 없음:

댓글 쓰기