• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >Android > 硅谷商城第二版3--分类模块,硅谷商城第二版3--

硅谷商城第二版3--分类模块,硅谷商城第二版3--

作者:网友 字体:[增加 减小] 来源:互联网 时间:2017-05-26

网友通过本文主要向大家介绍了硅谷商城,硅谷,硅谷亮城写字楼,济南硅谷培训学校,领秀新硅谷二手房等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

硅谷商城第二版3--分类模块,硅谷商城第二版3--


1、采用SegmentTabLayout实现标签和分类切换

fragment_type.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tl="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".type.fragment.TypeFragment">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:padding="5dp">

        <com.flyco.tablayout.SegmentTabLayout
            android:id="@+id/tl_1"
            android:layout_width="150dp"
            android:layout_height="35dp"
            android:layout_centerInParent="true"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="10dp"
            tl:tl_bar_color="#ffffff"
            tl:tl_indicator_color="#ff0000"
            tl:tl_indicator_corner_radius="20dp"
            tl:tl_tab_padding="23dp" />

        <ImageView
            android:id="@+id/iv_type_search"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/icon_search_white" />

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_alignParentBottom="true"
            android:background="#e4e4e4" />
    </RelativeLayout>

    <FrameLayout
        android:id="@+id/fl_type"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</LinearLayout>

2.分类Fragment

fragment_list.xml

<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".type.fragment.ListFragment">

    <ListView
        android:id="@+id/lv_left"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:background="#11000000"
        android:scrollbars="none"
        app:layout_widthPercent="22%" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rv_right"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_toRightOf="@id/lv_left"
        app:layout_widthPercent="78%" />
</android.support.percent.PercentRelativeLayout>

右边的:1、整体数据展示采用仿京东的分类页面; 2、热卖类型布局横向滚动采用HorizontalScrollView;

热卖:item_hot_right.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"
    android:padding="10dp">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:text="热卖推荐"
        android:textColor="#788188" />

    <HorizontalScrollView
        android:id="@+id/hsv_hot_right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scrollbars="none">

        <LinearLayout
            android:id="@+id/linear"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" />
    </HorizontalScrollView>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="常用分类"
        android:textColor="#788188" />
</LinearLayout>

item_ordinary_right.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ll_root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/iv_ordinary_right"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:background="@drawable/new_img_loading_2" />

    <TextView
        android:id="@+id/tv_ordinary_right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:text="古风"
        android:textColor="#000000" />
</LinearLayout>

  

3.标签fragment

<?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"
    android:padding="10dp">

    <TextView
        android:id="@+id/tv_tag"
        android:layout_width="100dp"
        android:layout_height="80dp"
        android:background="@drawable/tag_bg"
        android:gravity="center"
        android:lines="2"
        android:padding="10dp"
        android:text="喵星人"
        android:textColor="#f0a420"
        android:textSize="20sp" />
</LinearLayout>

  

 

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 硅谷商城第二版1--主框架,硅谷商城第二版1--
  • 硅谷商城第二版3--分类模块,硅谷商城第二版3--
  • 硅谷商城第二版5--个人中心模块,硅谷商城第二版5--
  • 硅谷商城第二版6--购物车模块,6--购物车
  • 硅谷商城3--购物车数据存储器,3--购物车
  • 硅谷商城4--显示购物车商品,硅谷商城4--购物车
  • 硅谷商城5--购物车商品选中和商品总价计算,5--购物车
  • 硅谷商城6--购物车编辑实现,硅谷商城6--购物车

相关文章

  • 2017-05-26fastdfs 使用遇到的问题
  • 2017-07-23从头开始学RecyclerView(六)LayoutManager
  • 2017-05-26我的Android第五章:通过Intent实现活动与活动之间的交互,androidintent
  • 2017-05-26zoom动画,实现图片点击预览效果,zoom预览
  • 2017-05-26RecyclerView再封装,RecyclerView封装
  • 2017-05-26踩坑实录 Android studio中关于 No cached version of **** available for of处理办法,androidcached
  • 2017-05-26基于Nginx实现10万+并发,你应该做的Linux内核优化
  • 2017-05-26Android动态加载Activity原理
  • 2017-05-26android:异步任务asyncTask介绍及异步任务下载图片(带进度条)
  • 2017-05-26Activity猫的一生-故事讲解Activity生命周期,activity生命周期

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • Activity猫的一生-故事讲解Activity生命周期,activity生命周期
    • 揭开AssetBundle庐山真面目(二)
    • Android开发7:简单的数据存储(使用SharedPreferences)和文件操作,
    • Mac OSX系统搭建React natvie for android 开发环境,osxnatvie
    • Android新手入门2016(10)--GridView
    • android:Activity数据传递之基本数据类型
    • 12306火车票订票项目源码,12306火车票订票
    • Json解析工具的选择,Json解析工具选择
    • android学习第一天(android的介绍和基础):,android第一天
    • 一.TextView 显示文本框控件, EditText 输入文本框,.textviewedittext

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有