问题描述
Android的类BaseAdapter在其名称中具有适配器,因为它遵循适配器模式,还是巧合?
所以,让我们来解释一下。 BaseAdapters指定要用于需要适配器的程序的接口。其实这个界面叫做Adapter。此接口指定采取任意列表所需的信息,并将其转换为任意长的视图集。 BaseAdapter因此适应您的自定义输入格式(特别是如果您扩展它)到适配器接口。因此,它是适配器设计模式。
Does Android's class BaseAdapter have "Adapter" in its name because it follows the Adapter pattern or is it just a coincidence?
So, let's discect that. BaseAdapters specify an interface to use for programs that need adapters. In fact, this interface is called Adapter. This interface specifies the information needed to take an arbitrary list, and convert it to an arbitrarily long set of Views. BaseAdapter thus adapts your custom input format (In particularly, if you extend it), to the Adapter interface. Thus, it is an Adapter design pattern.
这篇关于Android的BaseAdapter是适配器模式的示例吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!