【分享一个好看的Android item布局 使用于ListView,RecyleView JAVA版本(二)】
1.效果图:
2、思路与上文相同 此处略掉·····
3、布局层级:代码较长请耐心使用
// An highlighted block
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:layout_width="160dp"android:layout_height="155dp"app:cardCornerRadius="20dp"android:orientation="vertical"android:layout_marginTop="5dp"><androidx.cardview.widget.CardViewandroid:outlineSpotShadowColor="@color/black"app:cardCornerRadius="20dp"android:layout_width="match_parent"android:layout_height="match_parent"><LinearLayoutandroid:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"><com.makeramen.roundedimageview.RoundedImageViewandroid:layout_marginTop="5dp"android:layout_marginStart="5dp"android:layout_marginEnd="5dp"android:scaleType="center"app:riv_corner_radius="20dp"android:layout_width="match_parent"android:layout_height="90dp"android:src="@drawable/header_img"/></LinearLayout><LinearLayoutandroid:layout_marginTop="5dp"android:layout_marginStart="5dp"android:layout_marginEnd="5dp"android:orientation="horizontal"android:layout_width="match_parent"android:layout_height="wrap_content"><TextViewandroid:textSize="12dp"android:text="冬游川西 | 这些地方的雪季值得你说走就走!"android:textColor="@color/black"android:layout_width="0dp"android:layout_weight="1"android:layout_height="wrap_content"></TextView><ImageViewandroid:src="@drawable/header_item_right"android:layout_width="20dp"android:layout_height="20dp"/></LinearLayout><LinearLayoutandroid:layout_marginStart="5dp"android:layout_marginTop="3dp"android:orientation="horizontal"android:layout_width="match_parent"android:layout_height="wrap_content"><LinearLayoutandroid:layout_width="0dp"android:layout_weight="2"android:layout_height="wrap_content"><com.makeramen.roundedimageview.RoundedImageViewandroid:layout_marginTop="2dp"android:layout_width="10dp"android:layout_height="10dp"android:src="@drawable/headimg"app:riv_corner_radius="100dp"/><TextViewandroid:id="@+id/header_item_num"android:layout_marginStart="3dp"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="易小烊"android:textColor="@color/index_welcome_color"android:textSize="10sp"/></LinearLayout><LinearLayoutandroid:layout_marginEnd="5dp"android:layout_width="wrap_content"android:layout_height="wrap_content"><com.makeramen.roundedimageview.RoundedImageViewandroid:layout_marginTop="0.5dp"android:layout_gravity="center"android:layout_width="10dp"android:layout_height="10dp"android:src="@drawable/like"app:riv_corner_radius="100dp"/><TextViewandroid:layout_gravity="center"android:layout_marginEnd="5dp"android:layout_marginStart="1dp"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="80"android:textColor="@color/index_welcome_color"android:textSize="10sp"/></LinearLayout></LinearLayout></LinearLayout></androidx.cardview.widget.CardView></LinearLayout>
4 备注:
1.复制粘贴代码爆红原因
a、图片素材缺失,自己将自己喜欢的图片放入@drawable文件夹里重新引用即可
b、缺少依赖 本篇文章中使用了第三方库需要在你自己的项目中的build.gradle (Modle: xxx.app)添加以下依赖
implementation 'com.makeramen:roundedimageview:2.3.0'
c、作者联系方式QQ:2293667568
d、项目工程下载 :整体项目框架
链接:上传太慢 需要的直接加我QQ
【分享一个好看的Android item布局 使用于ListView,RecyleView JAVA版本(二)】相关推荐
- android漂亮的dialog,一个好看的Android AlertDialog
最近项目需求,需要一个好看一点的提示框,网上搜罗一番,发现sweetDialog 人气很高,但是到了实际使用的时候,发现有些问题不太好解决,而且已经三年没有更新了,而其他的库,更是达不到要求.所以索性 ...
- 分享一个好用的CSS布局
事情起因 之前参与了一个数据可视化看板的项目,刚开始甲方给的页面只是一个概念图,就是大概描述了屏幕上分几块,每一块放什么图表之类的,虽然很无语,但还是要继续开发挣饭吃.开发完毕之后,甲方才把UI设计图 ...
- 安卓Android Studio布局文件分类存放,java文件分类存放
备注:此备注将会存在本人的每一条博客,将会定期更改 1.使用的软件是Android studio 版本是3.5 当项目比较大的时候文件很多很复杂,这个时候就可以把一些布局文件进行归类存放 问题是我们自 ...
- 成为一个优秀的Android开发者,需要必备哪些技术工作技能?
我并不是要你去学习西班牙语或者中文,而是学习新的编程语言.随着科技的发展,你需要保持自己的知识更新,而不是把自己固定死在安卓一个方面. 这能够开阔你的视野,并能够显著地提升你的安卓开发技巧.下定决心每 ...
- 一个帖子掌握android所有控件、ProgressBar 、Android 动画效果、SQLite、四大组件、Android多媒体(转...
Android多媒体实例大汇集(源码,全)经过两个星期的多媒体学习,实现了一系列DEMO,几乎涵盖了Android中对媒体中的各个方面(当然底层除外). http://www.apkbus.com/a ...
- Android模仿新浪微博(自定义ListView下拉刷新)
自定义PullToRefreshListView继承ListView,在ListView头部添加一个下拉的头部布局.跟ListView用法完全一致. 该自定义Listview代码详解具体可参考: ht ...
- android 最新写法,详解Android 硬布局item的高级写法
本文主要介绍了Android 硬布局item的高级写法,分享给大家,具体如下: 效果: 这种布局应该是非常常见了,且写的比较多. 今天简单探讨一下效果图中上下两种布局的写法. 比较 上下效果一致 行数 ...
- android 广告效果图,Android_Android实现加载广告图片和倒计时的开屏布局,这是一个android开屏布局的实例 - phpStudy...
Android实现加载广告图片和倒计时的开屏布局 这是一个android开屏布局的实例,可以用于加载广告图片和倒计时的布局.程序中设置的LayoutParams,划分额外空间比例为6分之5,具体权重比 ...
- 分享一个Android源码在线阅读的网址
分享一个Android源码在线阅读的网址 :http://androidxref.com/4.2.2_r1/
最新文章
- Objective-C中.h、.m、.mm的区别
- canvas写的一个刮奖效果
- Spring Cloud构建微服务架构:分布式配置中心【Dalston版】
- 响应式Bootstrap后台管理系统模板UI框架
- 网店如何提高顾客的回购率?
- ASP.NET中WEB上弹出消息框的N种方法(为了以后方便,转了很多网友的文章!希望不会介意)...
- microsoft visual c++全家桶_“网蓝”盒子咖啡新品来袭!顺德第①桶MINI冰摇咖啡,可以背着逛街...
- 微服务架构实战篇(一):使用start.spring.io 构建SpringBoot2.0项目
- pcs7 v8.1服务器系统,PCS7 V8.1 SP1 AS PO授权 和OS PO授权和ES PO授权 具体 步骤 越详细越好...
- 支付交易相关接口文档对接
- html动态生成tr标签,JS动态添加tr元素
- 【Python】接收UDP数据(保姆级图文+附测试工具文件+api例程)
- 计算机u盘打不开怎么办,电脑*u盘打不开怎么办
- web服务器和应用服务器的区别
- php微信摇一摇开发文档,微信摇一摇页面管理
- 云端部署 vs 本地化部署
- The pylance server crashed 5 times in the last 3 minutes
- 网卡82583V在win2008上装驱动问题
- estimate, underestimate and overestimate
- Vue脚手架使用步骤