英文:
Creating stripped TableTows in android
问题
我已经在安卓中使用Java创建并动态添加了表格布局的行。现在我想知道是否可能使这些行变得有间隔,就像在Web页面中使用Bootstrap时所做的那样。
在安卓中使用Java是否有可能实现这一点,或者是否有可以用来实现这一点的库?
英文:
I have created and dynamically added rows to my table layout in android using java. Now I would like to know if it is possible to make the rows stripped like would be done using bootstrap in web pages
i.e this is what I have
And what I want is something like this
Is this possible in android using java or is there a library I can use to achieve this?
答案1
得分: 0
你可以在每个TableRow上设置交替的背景颜色。
另外,顺便提一下,RecyclerView 几乎总是比使用 TableLayout 更合适的解决方案。
英文:
You could just set alternating background colors on each TableRow.
Also, side not, RecyclerView is almost always the right solution instead of using TableLayout.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论