Android 在没有自定义列表视图适配器的情况下设置列表视图单元格的元素
我想做类似 mylistview.setElementsofView(0).getElementById.setColor("black");
目前我知道这样做的唯一方法是设置自定义列表视图适配器,设置构造函数,进行条件检查以查看视图是否已填充,然后在该视图中执行操作,
这看起来非常复杂,而列表视图的其他部分很容易访问。
是否有一些我可以在列表视图中访问的继承函数,以允许我在没有自定义适配器的情况下访问特定视图的元素?
感谢您的任何见解
I want to do something like mylistview.setElementsofView(0).getElementById.setColor("black");
currently the only way I know of doing this is setting up a custom list view adapter, setting up constructors, do conditional checks to see if view is populated, then do stuff in that view
this seems very convoluted, when other parts of the listview are so easily accessible.
is there some inherited function I can access in listview to allow me to access the elements of a particular view without a custom adapter?
Thanks for any insight
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对你的问题的简短回答:
不幸的是,答案是否定的。
您认为为什么设置自定义适配器如此复杂?只需将自定义适配器类设置为活动中的嵌套类即可。最有可能的是,您只想重写 getView() 方法。最后,与寻找“简单”解决方案相比,您花在这方面的时间会少得多。
The short answer to your question:
unfortunately is no.
Why do you think setting up a custom adapter is so convoluted? Just make the customized adapter class a nested class within your activity. Most likely, you'd only be looking at overriding the getView() method. In the end, you'll spend a lot less time doing this than looking for a "simple" solution.
怎么样
What about