OnClick 事件在运行时生成的小部件上执行
在我的应用程序中,我在运行时在 ScrollView 中显示 TableLayout。这都是在运行时生成的。我是从活动类而不是任何 xml 创建此视图。现在我想通过单击此生成表的一行来执行操作,以执行显示该行中写入的内容的详细信息。请帮助我们如何在滚动视图中单击运行时生成的表的一行来执行操作?
In my application i am displaying a TableLayout within an ScrollView at the runtime. This is all generating at runtime. I am creating this view from activity class, not from any xml. Now i want to perform an operation on the click of a row of this generated table to bring execution to display details of the content written in the row. Please help how we can perform operation on the click of a row of runtime generated table which is in Scroll View?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题不清楚,但是如果这是我的想法,请查看 view.setTag(),这将帮助您添加对另一个视图或任何对象的引用
所以在单击此视图时,使用 (View) view.getTag() 并更改可见性或对其执行某些操作。
Your question is not clear, However if it is what I think, have a look at view.setTag(), this will help you to add the reference to another view, or any object
So on click of this view, use (View)view.getTag() and change the visibility or do something with it.