Android 使用SimpleAdapter创建图文并茂的ListView

Simpleadapter的简单用法 public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); lv = (ListView) findViewById(R.id.listview); SimpleAdapter adapter = new SimpleAdapter(this, getData(), R.layout.list_item, new String[] { "img", "title", "info" }, new int[] { R.id.img, R.id.title, R.id.info }); lv.setAdapter(adapter); } private List<Map> getData() { List<Map> list = new ArrayList<Map>(); Map map = new HashMap(); map.put("img", R.drawable.aa); map.put("title", "111"); map.put("info", "数字111"); list.add(map); map = new HashMap(); map.put("img", R.drawable.ic_launcher); map.put("title", "aaa"); map.put("info", "字母aaa"); list.add(map); map = new HashMap(); map.put("img", R.drawable.aa); map.put("title", "222"); map.put("info", "数字222"); list.add(map); map = new HashMap(); map.put("img", R.drawable.ic_launcher); map.put("title", "bbb"); map.put("info", "字母bbb"); list.add(map); map = new HashMap(); map.put("img", R.drawable.aa); map.put("title", "333"); map.put("info", "数字333"); list.add(map); map = new HashMap(); map.put("img", R.drawable.ic_launcher); map.put("title", "ccc"); map.put("info", "字母ccc"); list.add(map); return list; } 立即下载

    先看一下成果吧(图片有点Low,用的系统自带的):


    SimpleAdapter的用法比ArrayAdapter还要复杂一点,毕竟功能更强大嘛。先看SimpleAdapter的构造方法:

public SimpleAdapter(Context context, List<? extends Map<String, ?>> data, int resource, String[] from, int[] to) {}

详细说一下方法中的5个参数:

* Context:上下文。
* data:数据源(List<Map<String,?>>data)一个有Map组成的集合。每一个Map都会对应ListView列表中的一行,每一个Map(键-值对)中的键必须包含所有在from参数中所指定的键。
*resource: ListView中每一项的布局文件ID。
*from:Map中的键名。
*to:绑定item.xml文件中的view控件ID,与from,Map的键形成对应。

    data数据源我专门用ItemData类生成:

package com.engineer.shizhibin.tvshow;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by 13922 on 2018/6/17.
 */

public class ItemData {
    private static String[] mDataList = new String[] {
            "CCTV1综合","CCTV2财经","CCTV3综艺","CCTV4中文国际","CCTV5","CCTV6","CCTV7","CCTV8",
            "CCTV9","CCTV10科教","CCTV11戏曲","CCTV12社会与法","CCTV13新闻"
    };
    private static String[] mUrlList = new String [] {};
    private static List<Map<String,Object>>datalist;
    public static String[] getmDataList() {
        return mDataList;
    }
    public static List<Map<String,Object>> getDataLIst(String...from) {
        datalist = new ArrayList<Map<String,Object>>();
        for(int i=0;i<mDataList.length;i++) {
            Map<String,Object>map = new HashMap<String,Object>();
            map.put(from[0],R.mipmap.ic_launcher_round);
            map.put(from[1],mDataList[i]);
            datalist.add(map);
        }
        return datalist;
    }
}

    每一个Item的布局,需要自定义item.xml:(注意id要和SimpleAdapter构造方法中的to参数对应)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView
        android:id="@+id/pic"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:src="@mipmap/ic_launcher_round"/>
    <TextView
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="20sp"
        android:textColor="#000"/>
</LinearLayout>

    在MainActivity中创建Adapter绑定ListView:

package com.engineer.shizhibin.tvshow;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class MainActivity extends AppCompatActivity {
    private ListView mListview;
    private SimpleAdapter mAdpater;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mListview = (ListView)this.findViewById(R.id.list);
        /**
         * 参数1 上下文
         * 参数2 当前listview加载的每一个列表项对应的布局文件
         * 参数3 数据源
         */
        String[] list = ItemData.getmDataList();
        List<Map<String,Object>> data = new ArrayList<Map<String,Object>>();
        data = ItemData.getDataLIst("pic","text");
        /**
         * SimpleAdapter的五个参数:
         * Context:上下文
         * data:数据源(List<Map<String,?>>data)一个有Map组成的集合
         *       每一个Map都会对应ListView列表中的一行
         *       每一个Map(键-值对)中的键必须包含所有在from参数中所指定的键
         *resource: ListView中每一项的布局文件ID
         *from:Map中的键名
         *to:绑定item.xml文件中的view控件ID,与from,Map的键形成对应
         */

        mAdpater = new SimpleAdapter
                (MainActivity.this,data,R.layout.item,new String[]{"pic","text"},new int[]{R.id.pic,R.id.text});
        mListview.setAdapter(mAdpater);
    }
}


Android UI:ListView – SimpleAdapter实例详解 Android UI:ListView — SimpleAdapter SimpleAdapter是扩展性最好的适配器,可以定义各种你想要的布局,而且使用很方便。 layout : <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=match_parent android:orientat 立即下载

相关推荐

Android SimpleAdapter适配器使用详解

Android SimpleAdapter使用详解 HolderAdapter背景 Android的AdapterView用的比较多,ListView,GridView,Spinner等,原生的BaseAdapter对ViewHolder没有支持,每次都要,定义内部类,inflater根布局,对item内部view设置clicklistener并转发到adapter的调用者等。写的次数多了感觉很繁琐,于是写了个简单的封装,简化Adapter的编写, 仓库连接http://git.oschina.net/phodev/SimpleAdapter. 主要文件介绍 1,CommonAdapter.j

SimpleAdapter(简单适配器)

SimpleAdapter(简单适配器):这个适配器不要被名字迷惑,看是简单,但功能强大 &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="mat...

sunshinedark的博客 2万+

骨架动作识别新突破:CTR-GCN的通道拓扑优化策略解析

本文深入解析了CTR-GCN在骨架动作识别中的通道拓扑优化策略。通过引入通道级拓扑细化,CTR-GCN克服了传统GCN共享拓扑结构的局限性,显著提升了动作识别的准确率。文章详细介绍了CTR-GCN的三大核心组件设计,包括特征变换模块、通道拓扑建模和通道聚合技术,并提供了实战调参经验和模型压缩技巧,为计算机视觉领域的研究者和开发者提供了有价值的参考。

weixin_27310417的博客 193

安卓入门--SimpleAdapter详解

【代码】安卓入门--SimpleAdapter详解。

m0_62089210的博客 1545

Vivado加上VsCode让你的生活更美好

VsCode与Vivado的灵活使用 引言 ​ 现在大二了,在接触硬件描述语言。Vivado自带的编辑器实在很难用,为了能够“极客”一些,当然是去Google了一下有哪些方法可以取而代之。 ​ 网络上的答案大同小异,基本上都是用的Sublime Text.(我的学长们也几乎都是) 平时码代码的过程中,我习惯与使用VsCode,尤其是在微软收购GitHub之后,Code 简直就是神器了。于是乎…一个...

qq_39498701的博客 10万+

【软件安装系列】Ubuntu+mysql5.7.27+Jira8.3.1+邮箱服务器配置+Confluence6.15.7安装经验和采坑总结

文章目录一、软件准备(百度云易被吞,就不放了)1.1 官网下载的新鲜的Jira和Confluence1.2 linux的jdk一份1.3 Jira和Confluence的破解程序或者破解包一份1.4 java的连接器一份二、安装过程1--java环境配置2.1 将下载下来的jdk包解压在/usr/local/java目录中2.2 写入环境变量三、安装过程2--mysql5.7.27环境配置3.1 ...

xiaosha_的博客 6892

Android——SimpleAdapter的简单使用

Android——SimpleAdapter的使用 1. Adapter 在Android中,Adapter(适配器)是数据与ui之间的桥梁,它把后台数据与前端ui连接到一起,是一个展示数据的载体。Adapter有很多的接口、抽象类、子类可以使用,以下是常用的几个。 BaseAdapter:是一个抽象类,继承它需要实现较多的方法,所以也就具有较高的灵活性; ArrayAdapter:支持泛型操作,最为简单,只能展示一行字。 SimpleAdapter:有最好的扩充性,可以自定义出各种效果。 SimpleCu

weixin_43857428的博客 1573

Redis Lua引擎UAF漏洞CVE-2025-49844深度剖析与复现实践

内存安全是软件系统稳定性的基石,其核心原理在于确保程序对内存的访问始终处于合法、受控的状态。在C/C++等手动管理内存的语言中,Use-After-Free(释放后使用)是一种典型的高危内存安全漏洞,它源于已释放的内存区域仍被程序指针引用,导致数据混乱或程序崩溃。这类漏洞的技术价值在于其往往能突破高级语言的安全边界,直接威胁进程本身,危害等级极高,常见于数据库、浏览器等核心基础设施。在Redis这样的高性能内存数据库中,其内置的Lua脚本引擎为复杂操作提供了强大支持,但同时也引入了沙箱环境下的复杂内存对象生

weixin_42530732的博客 365

ListView使用SimpleAdapter显示信息列表以及监听事件

此文,仅做为个人学习Android,记录成长以及方便复习!市场上常见的两种ListView图中的纯文字版包括标题和具体解释的item。图文并茂的ListView需要通过SimpleAdapter实现。本文使用的SimpleAdaptr实现图文并茂1.自定义布局文件items.xml&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayo...

qqazl001的博客 1486

UNSW-NB15数据集:网络流量分析与恶意攻击检测实战指南

本文提供了UNSW-NB15数据集在网络流量分析与恶意攻击检测领域的实战指南。详细介绍了该数据集的构成、核心特征解析、特征工程处理、机器学习模型训练与评估方法,并探讨了模型部署及持续优化的挑战与思路,帮助读者构建高效的网络攻击检测系统。

weixin_29193359的博客 258

高压脉冲发生器的各种电路图

高压脉冲发生器的各种电路图

qq_65102825的博客 5904

Android学习之listView显示下拉列表(2)(SimpleAdapter适配器)

ListView显示下拉列表(2)(SimpleAdapter适配器) 上一篇文章我大概介绍了listView的主要功能以及用ArrayAdapter数组适配器实现纯文本的下拉列表。但是在现实生活中,纯文本的使用率不是很高,更多的是用SimpleAdapter实现图文并茂的下拉列表,这种机制就和美团app和淘宝app的下拉列表一样了,但是SimpleAdapter相对比较复杂,下面我来一一介绍。

chief_IT_operate的专栏 1366

【EDA Tools】Spyglass 检查 Verilog 和 SystemVerilog 混合语言及 Lint 检查

Spyglass可以用于检查混合设计中的语言互操作性和一致性问题。对于设计中包含多种硬件描述语言的情况,Spyglass 能够识别并解析其中的模块及其互连,并对其进行验证。例如,在包含 Verilog 和 VHDL 的混合设计中,Spyglass 会自动识别并解析 Verilog 和 VHDL 文件及其相互连接。通过运行 Spyglass Lint 功能,可以检查混合设计中的语言一致性问题,例如不兼容的数据类型、互操作性问题以及其他可能导致设计故障或不一致的问题。

记录学习历程 5080

android ListView适配器之SimpleAdapter的用法

以前写过ListView的适配器中最简单的ArrayAdapter这个适配器,

chenfengdejuanlian的专栏 1796

倍福--RS232自由口实现

RS232/485通信协议是在现场中常用到的,比如触摸屏、温控模块等设备控控制器做通信,会常用到此类协议,本文介绍RS232/485自由口通信的实现,并用PC调试助手进行测试。 目 录 软硬件版本 3 1.1. 倍福Beckhoff 3 1.1.1. 控制器硬件 3 1.1.2. 控制器软件 3 硬件连接 3 2.1. PC COM介绍 3 2.2. RS232/RS485连接 3 3.2.1. N030…………. 4 3.2.2. N031…………. 4 2.3. 实际线路连接 5 PLC程序 7 3

weixin_41883890的博客 3284

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

Android列表视图(ListView--SimpleAdapter)学习

接上文          上一篇文章使用的是ListView中最简单的ArrayAdapter,而且可以很容易的看出,ArrayAdapter比较适合 单一的显示一些文本信息。不过这并不表明使用ArrayAdapter不能显示图片的信息。如下:         适配器需要使用的xml文件list.xml,其中TextView必须指定id,适配器需要 <LinearLayout xml

LCore的专栏 2978

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

使用SimpleAdapter创建ListView

使用SimpleAdapter创建ListView 通过ArrayAdapter实现的Adapter虽然简单、易用,但功能有限,它只能通过每个列表项是TextView,如果需要实现更复杂的列表项,则可以使用SimpleAdapter。 SimpleAdapter并非如名字简单,它的功能非常强大,可实现ListView的大部分应用。 使用如下: <RelativeLayout xmlns

萧萧北keno的专栏 1298

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

AndroidStudio中ListView的四种使用方法

AndroidStudio中ListView的四种使用方法 第一种: 打开AndroidStudio新建一个空白activity 首先在strings.xml中添加listview所需的数据 在activity_main.xml文件中添加一个ListView组件,并引用上一步创建的数据 在AndroidMainfest.xml中为MainActivity添加过滤器,运行MainActivity就可以了。 原码 MainActivity package com.example

weixin_49118013的博客 9767

Android之ListActivity的使用和在ListView中添加图片文字

Android之ListActivity的使用和在ListView中添加图片文字

kkfdsa132的专栏 1万+

Android Studio列表用法之一:ListView图文列表显示(实例)

前言: ListView这个列表控件在Android中是最常用的控件之一,几乎在所有的应用程序中都会使用到它。 目前正在做的一个记账本APP中就用到了它,主要是用它来呈现收支明细,是一个图文列表的呈现方式,下面就讲讲具体是如何实现的。 效果图: 该功能是在另一篇博文【Android Studio 使用V...

weixin_34232744的博客 1万+

ArrayAdapter--SimpleAdapter--ListView

学习目标: 1.理解ListView的基础使用 2.学习熟练运用两种适配器(ArrrayAdapter,SimpleAdapter)ListView解析: 作用:android系统中显示列表的控件 ListView控件: (每一个ListView都可以包含很多个列表项) 数据适配器: 作用:

..... 576

android listview 图文并茂

listView 可以用于duiyuyi private ListView schoolNews;

Jensen 703

Android中关于Adapter的使用(中)SimpleAdapter

在前面的两篇文章中,我们讲到了关于ArrayAdapter的使用。用ArrayAdapter来在ListView中展示数据是很不错的,但是很多时候,我们的ListView中,可不只是展示文字,我们还想展示图片呢。 可能有些朋友刚才会问,第二篇不是已经可以展示图片了吗?是的呀,但是它就只能展示我们在xml中定义给它的那一张啊。 而究其原因,其实是因为我们传给它的数据源就只有字符串,没有传

ColinGotoHere1的博客 681

Android开发笔记—ListView的基础使用

列表有两种适配器 ArrayAdapter 、 SimpleAdapter 数组适配器和简单适配器 数组适配器适用于纯文字或数字的列表展示 简单适配器适用于图文并茂的效果数组适配器的创建方式为: private ListView listView; private ArrayAdapter<String> arrayAdapter; //--以上变量定义在全局 list

林0507 829

Android控件之ListView

ListView是android最常用的控件之一,允许用户通过手指上下滑动的方式将屏幕外的数据滚动到屏幕内,同时屏幕上原有的数据将滚动出屏幕,例如可用于显示联系人信息,系统设置等。ListView用法有以下两种方式实现ListView: XML中配置ListView activity继承ListActivity

sywyg 7万+

Android初级开发(四)——补充4、ListView

ListView的学习和应用

qq_28585471的博客 371
上一篇: Android httpConnection练习
下一篇: Android 开发简单记事本程序(附源码)
bingoCoder
博客等级 码龄10年 1400粉丝 157原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值