【发布时间】:2016-10-30 17:47:09
【问题描述】:
我想在 Android Studio 的布局中创建一个固定行数和列数的网格或表格(例如 6x6 网格)。我尝试使用 GridLayout 和 GridView,但它需要您在其中放置 36 个 EditText(纯文本)视图以创建 6x6 网格。 TableLayout 的情况也是如此,您只能插入 TableRows 但不能固定列数。
Bottom line is, I want a 6x6 grid which has only a 6-letter word(one character in each cell) in the beginning and one letter is typed in every turn to make a word with the existing letters.
为此,我应该能够从任何单元格中读取相邻单元格中的字符。我不认为创建 GridView 或 TableLayout 并创建 36 个 EditTextView 对象将是最好的主意。有没有一种好的和有效的方法来做到这一点?我需要 .xml 文件代码及其 Java 类文件的代码。
【问题讨论】:
标签: java android xml android-layout android-studio