English 中文(简体)
简言之:提及过时的观点/确定一种与过时观点相容的独特之处
原标题:Android: Getting a reference to an inflated view/ Setting a unique id to the inflated view

我写了一份民意测验申请。

我有一个主要内容——意见、xml和民意调查——项目_view.xml.主_view.xml,只是所有投票结果的集装箱,而民意调查——项目——调查是一次特别的投票结果。 我在主谈中多次对投票进行点击,以显示投票结果清单。

现在,在人民投票时,我需要定期更新投票结果。 我需要一种办法,以提及每一次民意测验——在主角内排出的项目一。 我是否对每个投票项目进行独一无二的检查,我随后可以用来查阅一个部分投票项目。

Thanks, Aryan

问题回答

您可使用View.setTag

If you use onClickListener of your view you have a ref. to this view. If you update items outside, you can use indexes and getChildAt method.
Also good method to create wrappers of view with ref. to fields for quick access and update





相关问题
Very basic WPF layout question

How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...

How to align the text to top of TextView?

How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...

Centring a flow in Shoes

Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...

Overlaying with CSS

I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...

How do you normally make a program look beautiful? [closed]

How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...

热门标签