Android专项练习题
2015-10-05 11:36
441 查看
-->1. 使用SimpleAdapter作为 ListView的适配器,行布局中支持哪些组件?
answer: 解决上述问题可以通过以下方式,
----->1.搜索SimpleAdapter的API Reference,
![](https://img-blog.csdn.net/20151005115201256)
-----> 2.在IDE中打开SimpleAdapter.java
------>3.通过以上资料,总结出
SimpleAdapter支持的View按照顺序分别为:
---->1.实现Checkable接口的View
---->2.TextView
---->3.ImageView
Reference
answer: 解决上述问题可以通过以下方式,
----->1.搜索SimpleAdapter的API Reference,
-----> 2.在IDE中打开SimpleAdapter.java
/** * An easy adapter to map static data to views defined in an XML file. You can specify the data * backing the list as an ArrayList of Maps. Each entry in the ArrayList corresponds to one row * in the list. The Maps contain the data for each row. You also specify an XML file that * defines the views used to display the row, and a mapping from keys in the Map to specific * views. * * Binding data to views occurs in two phases. First, if a * {@link android.widget.SimpleAdapter.ViewBinder} is available, * {@link ViewBinder#setViewValue(android.view.View, Object, String)} * is invoked. If the returned value is true, binding has occurred. * If the returned value is false, the following views are then tried in order: * <ul> * <li> A view that implements Checkable (e.g. CheckBox). The expected bind value is a boolean. * <li> TextView. The expected bind value is a string and {@link #setViewText(TextView, String)} * is invoked. * <li> ImageView. The expected bind value is a resource id or a string and * {@link #setViewImage(ImageView, int)} or {@link #setViewImage(ImageView, String)} is invoked. * </ul> * If no appropriate binding can be found, an {@link IllegalStateException} is thrown. */ public class SimpleAdapter extends BaseAdapter implements Filterable
------>3.通过以上资料,总结出
SimpleAdapter支持的View按照顺序分别为:
---->1.实现Checkable接口的View
---->2.TextView
---->3.ImageView
Reference
相关文章推荐
- Android:screenrecord录制屏幕录像
- Android Studio 的 Preview窗口
- Android中SimpleAdapter详解
- Android系统中设置TextView的行间距(非行高)
- 【Android 学习】AndroidMainfest.xml详解
- Android开发者必须深入学习的10个应用开源项目
- Android Studio百度地图开发
- Android app 怎么替换logo及应用程序的名称-全新新手,请大牛指点
- Android封装支付宝支付
- Android 判断屏幕滑动
- Android学习【6】BroadcastReceiver和接口的使用
- Android Studio的top level element is not completed问题
- android ActionBar 兼容低版本之搜索功能
- Android之ArrayAdapter的详解
- android stdio扩大内存
- 【Android】集成QQ登录
- Android Demo---实现从底部弹出窗口
- Android Demo---实现从底部弹出窗口
- Android 学习笔记8——传感器使用
- 使用Mac开发Android/iOS/OS X图标生成工具推荐