Android:在动态表格行的右侧动态添加图像

标签 android tablelayout

我需要在动态生成的表格行的右侧添加 ImageView 。 我已将 ImageView 添加到表行中。如何在右侧添加图像,即将重力设置为右侧。 谁能帮我解决这个问题? 谢谢

最佳答案

您必须为表格行创建一个 XML 文件,然后使用 LayoutInflater 可以从该 XML 文件中获取 View 。

你要研究一下Layout Inflater

关于Android:在动态表格行的右侧动态添加图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8136380/

相关文章:

c# - 如何在 Unity Android 应用程序中使用 OpenCV 中的 ARCore 相机图像?

android - 如何保持滚动条的速度?

java - 如何从 ANDROID 中的 sqlite 数据库中获取数据??

android - Kotlin 结合了 2 个以上的流程

android - <TableLayout><TableRow><LinearLayout> 讨厌我。强制关闭运行。安卓

Jquery验证: 'one table row one form ' does not work

android - 应用内结算库存价格并不总是与用户打算购买时显示的货币相同

Android - 用户界面元素离开屏幕

html - 表格布局 :fixed rendering different in IE6/7 then IE8/Chrome/FF

Android:TableLayout 将第一列右对齐,第二列左对齐