zoukankan      html  css  js  c++  java
  • 如何限制listview的显示个数

    如何限制供热gridview 和listview显示的个数;

    思路问题:加载两个,我只拿两条出来

    Log.i("查询结果", result);
         JSONObject jsonObject = new JSONObject(result);
         map.put("code", jsonObject.getString("code"));// 状态0异常 1正常
         JSONArray jsonArray = jsonObject.getJSONArray("data");
         JSONObject jsonObject2;
         for (int i = 0; i < 2; i++) {
          Map<String, Object> map = new HashMap<String, Object>();
          jsonObject2 = (JSONObject) jsonArray.opt(i);
          map.put("id", jsonObject2.getInt("id"));// 视频id
          map.put("name", jsonObject2.getString("name"));// 视频名称
          map.put("imgPath", jsonObject2.getString("imgPath"));// 预览图地址
          map.put("videoPath", jsonObject2.getString("videoPath"));// 视频路径
          map.put("duration", jsonObject2.getString("duration"));// 视频长度
          map.put("integral", jsonObject2.getString("integral"));// 积分
          map.put("createTime",
            jsonObject2.getString("createTime"));// 创建时间
          map.put("watchCount", jsonObject2.getInt("watchCount"));// 观看次数
          map.put("createTime",
            jsonObject2.getString("createTime"));// 创建时间
          // map.put("bitmap",
          // Net.getBitmap(jsonObject2.getString("imgPath")));//
          // 广告图片
          map.put("path", jsonObject2.getString("imgPath"));
          videolist.add(map);

     

  • 相关阅读:
    java——io、字节流缓冲区拷贝文件、字节缓冲流
    java——斗地主小游戏之洗牌发牌
    java——HashMap、Hashtable
    java——模拟新浪微博用户注册
    [bzoj 1492][NOI2007]货币兑换Cash
    [bzoj 1010][HNOI 2008]玩具装箱
    [bzoj 2875][noi2012]随机数生成器
    [bzoj 4872][六省联考2017]分手是祝愿
    [bzoj 3566][SHOI 2014]概率充电器
    [bzoj 3534][Sdoi2014] 重建
  • 原文地址:https://www.cnblogs.com/childhooding/p/4461759.html
Copyright © 2011-2022 走看看