如何在 Android SlidingDrawer 控件中拥有多个按钮
我正在制作一个测验应用程序,我计划在其中使用 SlidingDrawer 控件来显示不同的问题编号。单击数字将允许用户跳转到特定问题。
我已经实现了滑动抽屉控件,但根据屏幕尺寸,它只能在其中显示 6-7 个按钮。尝试向其中添加更多按钮会出现异常。 我尝试在 SlidingDrawer 中使用 GridView 但我不断收到错误。
无论如何,我可以在 SlidingDrawer 控件内以类似网格的方式排列大约 20-30 个按钮吗?
请就我可以以不占用太多屏幕空间的方式实现类似功能的任何其他方式提出建议?
I am making a quiz application in which i am planning to use the SlidingDrawer control for displaying different question numbers. Clicking on a number will allow the user to jump to a specific question.
I have implemented the sliding drawer control but it is able to display only 6-7 buttons inside it depending on the screen size. Trying to add more buttons to it gives an exception.
I tried using a GridView inside the SlidingDrawer but i keep getting an error.
Is there anyway i can have around 20-30 buttons inside the SlidingDrawer control arranged in a grid like manner ?
Please give suggestions on any other way i can implement similar functionality in a way that doesn't take up much screen space ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是可能的,事实上以前的 Android 版本(如果我没记错的话,1.6)就是以这种方式实现应用程序启动器的。
搜索该版本的源代码,您将获得一个工作示例。
Yes, it's possible, as a matter of fact previous Android versions (1.6 if I'm not wrong) implemented the application Launcher that way.
Search the source for that version and you'll have a working sample.