Android HorizontalScrollView 水平滑动 在listview上面动态添加图片

Android HorizontalScrollView 水平滑动 在listview上面动态添加图片,第1张

Android HorizontalScrollView 水平滑动 在listview上面动态添加图片

@Override

public void onClick(View v) {

Uri uri = Uri.parse(href);

Intent intent = new Intent(Intent.ACTION_VIEW,

uri);

startActivity(intent);

}

});

}

header_ll.addView(coupon_home_ad_item);

}

lv.addHeaderView(headerView);// 通过listview的addHeaderView方法 将header添加到

// listview里面

// listview的测试数据

for (int i = 0; i < 20; i++) {

arrayList.add(i + " ------------- "

  • System.currentTimeMillis());

}

ArrayAdapter adapter = new ArrayAdapter(this, R.layout.item,

R.id.textView1, arrayList);

lv.setAdapter(adapter);

}

}

xml代码:

《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》

【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整资料开源分享

activity_main.xml

xmlns:tools=“http://schemas.android.com/tools”

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:background="#f4f4f4"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

tools:context=“com.baozi.bzhorizontalscrollview.MainActivity” >

android:id="@+id/lv"

android:layout_width=“fill_parent”

android:layout_height=“fill_parent” >

item_home_header.xml

xmlns:ptr=“http://schemas.android.com/apk/res-auto”

android:id="@+id/coupon_home_ad_hv"

android:layout_width=“fill_parent”

android:layout_height=“fill_parent”

android:orientation=“vertical”

android:scrollbars=“none” >

android:id="@+id/header_ll"

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginBottom=“15dp”

android:background="#dddddd"

android:orientation=“horizontal” >

home_item.xml

xmlns:ptr=“http://schemas.android.com/apk/res-auto”

android:id="@+id/coupon_home_ad_ll"

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginBottom=“10dp”

android:layout_marginLeft=“5dp”

android:layout_marginRight=“5dp”

android:layout_marginTop=“10dp”

android:gravity=“center”

android:orientation=“horizontal” >

android:id="@+id/coupon_ad_iv"

android:layout_width=“120dp”

android:layout_height=“90dp”

android:layout_margin=“4dp”

android:background="@drawable/ic_launcher"

android:scaleType=“centerCrop” />

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

android:text=“点我”

android:textColor="#000000"

android:textSize=“20sp” />

android:layout_width=“1dp”

android:layout_height=“90dp”

android:background="#000000" />

步骤:

首先加载 header

headerView = LayoutInflater.from(this).inflate(R.layout.item_home_header,null);

header_ll = (LinearLayout)headerView.findViewById(R.id.header_ll);

最后

上面这些公司都是时下最受欢迎的互联网大厂,他们的职级、薪资、福利也都讲的差不多了,相信大家都是有梦想和野心的人,心里多少应该都有些想法。

也相信很多人也都在为即将到来的金九银十做准备,也有不少人的目标都是这些公司。

我这边有不少朋友都在这些厂工作,其中也有很多人担任过面试官,上面的资料也差不多都是从朋友那边打探来的。除了上面的信息,我这边还有这些大厂近年来的面试真题及解析,以及一些朋友出于兴趣和热爱一起整理的Android时下热门知识点的学习资料。

部分文件:


准备,也有不少人的目标都是这些公司。

我这边有不少朋友都在这些厂工作,其中也有很多人担任过面试官,上面的资料也差不多都是从朋友那边打探来的。除了上面的信息,我这边还有这些大厂近年来的面试真题及解析,以及一些朋友出于兴趣和热爱一起整理的Android时下热门知识点的学习资料。

部分文件:
[外链图片转存中…(img-zXdCD4Wa-1640918281705)]
[外链图片转存中…(img-wsapMhSi-1640918281706)]
[外链图片转存中…(img-eaM1iDA3-1640918281707)]

本文已被CODING开源项目:《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》收录

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5693610.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存