废话不说直接上图

mian.xml 代码如下

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" ><!-- 属性解释:android:divider  添加分割线android:dividerHeight 分割线的高度android:cacheColorHint ListView是常用的显示控件,默认背景是和系统窗口一样的透明色,如果给ListView加上背景图片,或者背景颜色时,滚动时listView会黑掉,原因是,滚动时,列表里面的view重绘时,用的依旧是系统默认的透明色,颜色值为#FF191919,要改变这种情况,只需要调用listView的setCacheColorHint(0),颜色值设置为0或者xml文件中listView的属性 Android:cacheColorHint="#00000000"即可,滚动时,重绘View的时候就不会有背景颜色。android:listSelector 添加背景选择器--><ListView android:layout_width="fill_parent"android:layout_height="fill_parent"android:divider="@null"android:dividerHeight="0dip"android:cacheColorHint="#00000000"android:id="@+id/itemlist"android:listSelector="@drawable/list_item_style"></ListView>
</LinearLayout>

listview.xml 代码如下

<?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:orientation="vertical" ><TextView android:id="@+id/TextView01"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textColor="@android:color/black"     android:background="@drawable/bg"></TextView></LinearLayout>

背景选择器 list_item_style.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" ><item android:state_selected="true"android:drawable="@android:color/transparent" /><item android:state_pressed="true" android:state_selected="false"android:drawable="@android:color/transparent" /><item android:state_selected="false"android:drawable="@android:color/white" /></selector>

背景选择器《 参考》
java code

public class HandcentActivity extends Activity {private ListView itemlist;private List<Map<String, Object>> list;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);itemlist = (ListView)findViewById(R.id.itemlist);refreshListItems();}private void refreshListItems() {list = buildListForSimpleAdapter();SimpleAdapter notes = new SimpleAdapter(this, list, R.layout.listview,new String[] { "str" }, new int[] { R.id.TextView01,});itemlist.setAdapter(notes);itemlist.setSelection(0);}/*** 模拟适配器加载的数据* @return*/private List<Map<String, Object>> buildListForSimpleAdapter() {List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(2);Map<String, Object> map = new HashMap<String, Object>();map.put("str", "老张,小王没来上班");list.add(map);map = new HashMap<String, Object>();map.put("str", "呵呵");list.add(map);map = new HashMap<String, Object>();map.put("str", "昨天晚上聊天说他很忙,晚上回家有要事要办");list.add(map);map = new HashMap<String, Object>();map.put("str", "你懂的");list.add(map);map = new HashMap<String, Object>();map.put("str", "呵呵呵呵呵呵呵呵呵呵\n呵呵呵呵\n呵呵\n呵呵");list.add(map);map = new HashMap<String, Object>();map.put("str", "呵呵呵呵呵呵呵呵呵呵呵呵呵呵\n呵呵呵呵");list.add(map);return list;}
}

《 代码下载》

android handcent短信 仿iphone气泡聊天相关推荐

  1. android 同步短信到iphone,教你把短信从安卓同步到iPhone

    在电脑上登录网页版QQ同步助手,在"我的资料库"找到短信,点击全选,然后"到处本组全部短信"(注意提示的解压密码): 导出的文件格式为.csv,至此第一步结束. ...

  2. Android仿微信气泡聊天界面设计

    Android仿微信气泡聊天界面设计 微信的气泡聊天是仿iPhone自带短信而设计出来的,不过感觉还不错可以尝试一下仿着微信的气泡聊天做一个Demo,给大家分享一下!效果图如下: 气泡聊天最终要的是素 ...

  3. iphone转android 短信通知,如何将短信从iPhone转移/切换到Android

    作者:Selena Komez5月27,2017上更新 "我得到了新的华为手机,试用Android系统,我决定放弃旧的iPhone 6. 但是,我不知道如何通过简单的步骤将短信从iPhone ...

  4. android iphone6 同步短信,如何将Android手机短信备份到iPhone6

    最新文章: Virson的博客 文章来自: Lattice 很之前都问过这个问题,我应该如何将Android短信备份到Apple iPhone6?实际上,我之前曾使用过各种软件进行测试,发现如果没有越 ...

  5. Android之——短信的备份与还原

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/47091281 眼下,Android手机中的一些软件能够实现手机短信的备份与还原操作 ...

  6. android 获取短信验证码倒计时

     android 获取短信验证码倒计时 public class MainActivity extends Activity { private Button submit;     privat ...

  7. android发送短信

    使用android发送短信,需要先进行添加发送,读取短信新的权限: <uses-permissionandroid:name="android.permission.RECEIVE_S ...

  8. Android接收短信-createFromPdu

    createFromPdu(byte[]) method was deprecated in API level 23. Use createFromPdu(byte[], String) inste ...

  9. android自动回复退订,Android实现短信自动回复,挂电话

    原标题:Android实现短信自动回复,挂电话 简单功能,配置一下ITelephoney,ITelephony这个接口不能直接用的. 需要先在src下新建包com.android.internal.t ...

最新文章

  1. 分享一个小工具:Excel表高速转换成JSON字符串
  2. Yann LeCun:距离“真正的” AI,我们还缺什么?
  3. 企业网络推广——企业网络推广表示网站优化少不了这三大技能
  4. Oracle NVL与Coalesce函数的区别
  5. JS原型链中的属性问题
  6. 20155229 实验一《Java开发环境的熟悉》实验报告
  7. C# 操作线程的通用类[测试通过]
  8. SRS之SrsRtmpConn::publishing详解
  9. UE4粒子渲染不出来解决方法
  10. 移动端H5强制页面横屏展示
  11. 远程桌面计算机密码是多少,局域网远程桌面连接密码
  12. java503错误是什么_java - Tomcat 503错误 - 堆栈内存溢出
  13. linux 搭建mycat
  14. C# DLL资源文件打包(图片、JS、CSS)[WebResource]
  15. GPT专业应用:如何让GPT策划方案
  16. 红皮书再总结——实例四
  17. ERP/MIS系统中集成命令行式的功能调用
  18. Whitelabel Error Page 解决办法
  19. android常用刷机指令,刷机以及常用命令
  20. 微型计算机的主要硬件以及技术指标,微型计算机的硬件组成.doc

热门文章

  1. eclipse项目出现感叹号——快速解决
  2. 微信公众号支付之openID的获取
  3. vue路由,父子路由跳转,父页面隐藏
  4. 嗨,华为,我想找个“懂行”的人
  5. Latex中item的用法:自定义标号
  6. 实用新型专利申请条件及申请流程解析
  7. Lucene分词实现---Analyzer、TokenStream(Token、Tokenizer、Tokenfilter)
  8. 无奇不有! Matplotlib竟然也可画出“扭扭捏捏”的数据可视化图片!
  9. Node.JS后端开发基础
  10. python豆瓣电影需研究的问题_基于Python对豆瓣电影数据爬虫的设计与实现