简体   繁体   中英

How to check if a button is clicked or not?

I used a GridLayout to arrange the board and have 9 buttons to represent the individual game squares. There is going to be an array to hold each of the buttons unless there is an efficient alternative to handling the group of buttons. If the button is clicked, the square should change to an X or O. Any help on implementing the design would be helpful, although I am not looking for the entire solution.

在此处输入图片说明

button.settag(0);  --> X
button.settag(1);  --> O

button.gettag();

我遇到了这个问题,这是我发现使用Toast的最好方法。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM