Android中的ListView和适配器,是否属于适配器设计模式?

编程入门 行业动态 更新时间:2024-10-12 05:46:23
本文介绍了Android中的ListView和适配器,是否属于适配器设计模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我只是Android应用程序开发的初学者.我开始创建ListView并处理ListView的内容.众所周知,我们通常将Adapter用作数据,并将View提供程序用于ListView.有人怀疑这真的属于正常的Adapter Design Pattern之下.另一个疑问是我是否要从第三方API获取列表的内容.在本文中,我使用两种视图类型,一种是在从API加载内容时显示加载视图,另一种是普通的View(ListRow).这是个好方法吗?任何帮助或解释将不胜感激.

I'm just a beginner in Android application development. And I came to this creating ListView and manipulating content for the ListView. We all know we usually use Adapter as a data and View provider for the ListView. Have one doubt is this really falls under the normal Adapter Design Pattern. One more doubt I'm fetching the content for my list from a third party API. In this I'm using two types of Views one is to show the loading view while the content is getting loaded from the API and the other is the normal View(ListRow). Is it good way of doing it ? Any help or explanation would be largely appreciated.

谢谢

推荐答案

Android List Adapters关注创造物对象而不是结构模式.我想知道为什么这个名称是Adapters.他们会像某些ItemListFactory一样命名它.

Android List Adapters follow creational object not structural pattern. I wonder why this name Adapters. They would have named it like some ItemListFactory.

更多推荐

Android中的ListView和适配器,是否属于适配器设计模式?

本文发布于:2023-10-30 05:01:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1541837.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:适配器   模式   Android   ListView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!