Android通过实现GridView的横向滚动实现仿京东秒杀效果-创新互联

实现GridView的横向滚动

目前成都创新互联已为上千余家的企业提供了网站建设、域名、虚拟空间、网站改版维护、企业网站设计、芜湖网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

效果如下图:

具体实现的代码

•1. 主界面布局代码:activity_main.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" >
  <HorizontalScrollView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp" >
    <LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="fill_parent"
      android:layout_margin="10dp" >
      <GridView
        android:id="@+id/home_grid"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:gravity="center"
        android:numColumns="auto_fit"
        android:stretchMode="spacingWidthUniform" >
      </GridView>
    </LinearLayout>
  </HorizontalScrollView>
</LinearLayout>

本文题目:Android通过实现GridView的横向滚动实现仿京东秒杀效果-创新互联
文章源于:https://www.cdcxhl.com/article0/csseio.html

成都网站建设公司_创新互联,为您提供响应式网站品牌网站建设定制开发网站制作微信公众号关键词优化

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

绵阳服务器托管