当前位置: 首页 > news >正文

百度网站推广怎么样广点通投放平台登录

百度网站推广怎么样,广点通投放平台登录,汽车之家官网首页,英文网站制作 官网本人初学Android#xff0c;今天研究到Adapter这块感觉挺有意思的#xff0c;写了个自定义列表进行测试 首先我们新建一个layout列表布局文件#xff0c;具体布局可以自己设定。 下面贴上我的自定义布局文件代码 1 ?xml version1.0 encodingutf-8今天研究到Adapter这块感觉挺有意思的写了个自定义列表进行测试   首先我们新建一个layout列表布局文件具体布局可以自己设定。 下面贴上我的自定义布局文件代码   1 ?xml version1.0 encodingutf-8?2 LinearLayout xmlns:androidhttp://schemas.android.com/apk/res/android3 android:orientationhorizontal4 android:layout_widthmatch_parent5 android:backgrounddrawable/list6 android:layout_heightwrap_content7 8 ImageView9 android:idid/ico 10 android:layout_width64dp 11 android:layout_height64dp 12 android:backgroundmipmap/ic_launcher/ 13 LinearLayout 14 android:layout_widthmatch_parent 15 android:layout_heightwrap_content 16 android:orientationvertical 17 TextView 18 android:idid/biaoti 19 android:layout_widthmatch_parent 20 android:layout_heightwrap_content 21 android:text我是标题 22 android:layout_marginTop5dp 23 android:textSize22sp/ 24 TextView 25 android:idid/content 26 android:layout_marginTop5dp 27 android:layout_widthmatch_parent 28 android:layout_heightwrap_content 29 android:textSize16sp 30 android:text我是项目信息/ 31 /LinearLayout 32 /LinearLayout   上面代码的效果图如下整体用的是一个Image以及两个TextView   不好看就先凑合吧测试用 接下来我们开始MainActivity.java 1 package yuntu.com.yuntu;2 3 import android.support.v7.app.AppCompatActivity;4 import android.os.Bundle;5 import android.view.View;6 import android.widget.AdapterView;7 import android.widget.ListView;8 import android.widget.SimpleAdapter;9 import android.widget.TextView; 10 import android.widget.Toast; 11 import java.util.ArrayList; 12 import java.util.HashMap; 13 import java.util.List; 14 import java.util.Map; 15 16 public class MainActivity extends AppCompatActivity { 17 private ListView listView; 18 //声明标题 19 private String[] title new String[]{ 20 我是第1个Title, 我是第2个Title, 我是第3个Title, 我是第4个Title 21 }; 22 //声明内容 23 private String[] content new String[]{ 24 我是第1个content, 我是第2个content, 我是第3个content, 我是第4个content 25 }; 26 //声明图标 27 private int[] imgIds new int[]{R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher,R.mipmap.ic_launcher}; 28 Override 29 protected void onCreate(Bundle savedInstanceState) { 30 super.onCreate(savedInstanceState); 31 setContentView(R.layout.activity_main); 32 listView (ListView) findViewById(R.id.list_item01); 33 ListMapString, Object listitem new ArrayListMapString, Object(); 34 for (int i0;icontent.length;i){ 35 MapString, Object map new HashMapString, Object(); 36 map.put(ico,imgIds[i]); 37 map.put(title,title[i]); 38 map.put(content,content[i]); 39 listitem.add(map); 40 } 41 SimpleAdapter simpleAdapter new SimpleAdapter(this,listitem,R.layout.main_list,new String[]{title,content,ico},new int[]{R.id.biaoti,R.id.content,R.id.ico}); 42 listView.setAdapter(simpleAdapter); 43 44 listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { 45 Override 46 public void onItemClick(AdapterView? parent, View view, int position, long id) { 47 TextView bt (TextView) view.findViewById(R.id.biaoti); 48 TextView nr (TextView) view.findViewById(R.id.content); 49 Toast.makeText(MainActivity.this, bt.getText() | nr.getText(), Toast.LENGTH_SHORT).show(); 50 } 51 }); 52 } 53 }      //本篇文章记录日常代码希望也可以帮到需要的人                    ————鲨哒哒 转载于:https://www.cnblogs.com/shadada/p/6903637.html
http://www.huolong8.cn/news/141492/

相关文章:

  • 宁波专业网站推广平台咨询环球资源网成立时间
  • 中怎么做网站上下载图片的功能南昌外包建站
  • 制作商城网站西安官网seo收费
  • 巩义专业网站建设公司推荐.net开发的网站有哪些
  • 网站模板文件扫描win10部署wordpress
  • 网站关键词 查询制作网页需要用到哪些工具
  • 梅江区建设局网站做婚礼请柬的网站有哪些
  • 昆明做网站那家好古典网站建设
  • 会声会影模板免费网站seo技术分类
  • 专门做招商的网站是什么意思广州设计公司网站
  • 能绑定域名的免费网站安徽合肥做网站的公司有哪些
  • 学生做网站期末作业wordpress适合百度
  • WordPress建影视站十大网络营销经典案例
  • 网站建设视频教程网字节跳动现有员工人数
  • 计算机科学与技术 开题报告 网站建设医疗器械网上采购平台
  • 潍坊网站建设小程序php开发做网站
  • vs210做网站国内创意网页设计
  • 电话号码宣传广告汕头百度seo电话
  • 常州自助做网站wordpress建站博客
  • 移动网站的设计报告织梦的手机端网站模板下载地址
  • flask做视频网站广州百度seo
  • 百度做的网站 如果不做推广了 网站还保留吗国外flash网站模板
  • 网站空间换了 使用原有域名软文广告经典案例分析
  • 网站建设财务计划与预测小广告网页
  • 旅游网站建设解决方案重庆做网站推广
  • 对于政务网站建设的建议h5如何做多页面网站
  • 网站布局设计排版深圳龙岗房价
  • 百事企业的网站建设类型网站平台建设的作用
  • 苏州网站建设联系电话平度建设网站
  • 做网站有底薪吗framer网页界面设计