Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 android 中开发一个大脑转动游戏,有点像 einstien 挑战游戏。我希望每次用户进入新级别时,相同大小的多个圆形图像视图出现在唯一的随机位置。请建议。
您肯定需要使用生成随机位置
Random r = new Random(); int position1 = r.nextInt(30 - 10) + 10;
这将生成介于 10(含)和 30(不含)之间的随机数。