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

网络营销定价的特点有上海知名seo公司

网络营销定价的特点有,上海知名seo公司,东莞常平网站建设,整合营销传播方案前言 前面在适配器章节&#xff0c;已经介绍了ListView的作用(干什么的)&#xff0c;这节将主要介绍如何去设计ListView页面视图。 思考 列表视图需要些什么&#xff1f; 1. 列表项容器&#xff08;装载各列表项的容器&#xff09;&#xff1a;<ListView/> 2. 列表项布局…

前言

前面在适配器章节,已经介绍了ListView的作用(干什么的),这节将主要介绍如何去设计ListView页面视图。

思考

 列表视图需要些什么?

1. 列表项容器(装载各列表项的容器):<ListView/>

2. 列表项布局:my_list_item.xml

3. 列表所需数据:List<Object>、Adapter(桥梁)

 代码示例

下面的代码示例,是从我的项目中copy的是一个很好的例子

 

// 1. 列表项容器:activity_charge_up.xml(仅展示了相关部分)
<ListViewandroid:id="@+id/cuisine_list"android:layout_width="match_parent"android:layout_height="match_parent">
</ListView>// 2. 列表项布局:cuisine_list_item.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="60dp"android:background="#FEFCEB"android:layout_margin="10dp"><TextViewandroid:id="@+id/cuisineName"android:layout_width="75dp"android:layout_height="wrap_content"android:layout_centerVertical="true"android:layout_marginLeft="20dp"android:text="西红柿炒鸡蛋"android:textColor="@color/black"android:textSize="12sp"></TextView><TextViewandroid:id="@+id/cuisinePrice"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerVertical="true"android:layout_marginLeft="5dp"android:layout_toRightOf="@+id/cuisineName"android:text="¥99.90"android:textColor="#FF1100"android:textSize="12sp"android:textStyle="bold"></TextView><Buttonandroid:id="@+id/subCuisine"android:layout_width="30dp"android:layout_height="30dp"android:layout_centerVertical="true"android:layout_toLeftOf="@+id/cuisineQuantity"android:textSize="5dp"android:background="@drawable/sub"></Button><TextViewandroid:id="@+id/cuisineQuantity"android:layout_width="20dp"android:layout_height="wrap_content"android:layout_centerVertical="true"android:layout_toLeftOf="@+id/addCuisine"android:gravity="center"android:text="0"android:textColor="@color/black"android:textSize="10dp"></TextView><Buttonandroid:id="@+id/addCuisine"android:layout_width="30dp"android:layout_height="30dp"android:background="@drawable/add"android:layout_alignParentRight="true"android:layout_centerVertical="true"android:textSize="5sp"></Button></RelativeLayout>
</RelativeLayout>

适配器的使用很简单:

MyAdapter myAdapter = new MyAdapter(参数); 
ListView cuisineList = findById(R.layout.cuisine_list);
cuisineList.setAdapter(myAdapter);

复杂的是适配器的业务逻辑(适配器的实现):

    对于适配器的实现,可以参考前面适配器章节,这里就不再做具体的代码示例。

    在实际需求中,在适配器中你可能需要接受多个参数,你需要处理列表项的交互(譬如点击),你可能也需要即时地去改变列表项所在页面的相关控件内容(因为修改列表项一般也需要修改其他页面元素)。

 导航栏

其实学习ListView后,当想到设计导航栏后,可能会想到它能否胜任导航栏的设计呢?

        并不好去设计。首先,导航栏不仅有竖直的,还有水平的;其二,导航栏不仅仅是导航栏的变化,更涉及到导航内容的变化。

        所以导航栏的设计,一般有以下两种策略:

        (1) 自己设计:导航(LinearLayout)、导航页面内容(removeAllViews+addView+LayoutInflater)

        (2) 可用控件FragmentViewPager(参考链接:Android四种底部导航栏实现)

后言

 下一节,将介绍RecyclerView的相关知识

http://www.tj-hxxt.cn/news/102267.html

相关文章:

  • 沈阳网站开发公司百度搜索风云榜游戏
  • 北京企业网站建设方国内seo公司
  • 如何设置网站icon百度怎么优化网站关键词
  • 最近国内色情网站做的最好的是哪个长沙网络推广
  • 知名网站域名友妙招链接怎么弄
  • 企业网站建设管理系统上海优化公司选哪个
  • 别人不能注册我的wordpress站东莞网站快速排名提升
  • asp.net做网站源代码营销型网站分为哪几种
  • 修机械师怎么做我小样网站角仰望百度站长平台链接
  • 无限容量网站sem竞价专员
  • 动漫毕业设计作品网站网站开发月薪多少钱
  • 沧县网站制作seo上首页
  • 8月4日建设部网站通报网站如何做推广
  • php 政府网站源码百度热词
  • 网站做的好不好看什么海外网络推广
  • 网站开发与发布广西网站seo
  • 永康网站建设什么软件推广效果好
  • 去哪找网站建设公司seo助力网站转化率提升
  • 有哪些网站是用php做的在百度上打广告找谁推广产品
  • 广告公司寮步网站建设哪家好市场营销七大策略
  • 上海网站建设价格表怎么给产品找关键词
  • 沙特政府建设部网站产品推广运营的公司
  • 网站报价书公司网站推广
  • 网站被降权会发生什么扬州网站seo
  • 成都网站建设四易维达打开浏览器直接进入网站
  • 提供网站制作百度一下进入首页
  • 南昌网站seo外包自动推广软件免费
  • 用网站做宣传的费用网络营销有哪些内容
  • 网站开发与服务合同范本广州百度竞价外包
  • 个人可以做导航网站吗国外域名注册