900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > android 微信评论功能 Android仿微信朋友圈点击评论自动定位到相关行功能.pdf

android 微信评论功能 Android仿微信朋友圈点击评论自动定位到相关行功能.pdf

时间:2020-11-25 08:19:15

相关推荐

android 微信评论功能 Android仿微信朋友圈点击评论自动定位到相关行功能.pdf

Android仿仿微微信信朋朋友友圈圈点点击击评评论论自自动动定定位位到到相相关关行行功功能能

这篇文章主要介绍了android仿微信朋友圈点击评论自动定位到相关行功能的实现,本文图文并茂给大家介绍的非常

详细 具有一定的参考借鉴价值 需要的朋友可以参考下

最近闲来无事 随便看看各种UI实现的代码

本文涉及到的相关代码已经上传到 /android_demo/tree/master/WeixinEdit ext

打开你的微信朋友圈 点击评论 你就会发现有一个小细节 :文本输入框的高度恰好定位到这条信息的底部位置

这个实现起来其实很简单 咱们就来看看吧

最简单的RecyclerView

依然是先实现RecyclerView。跟朋友圈一样 我们也把头给加上去 这样我们在点第一条信息的时候 效果会更好一

信息内容简单些 反正我们就看看效果

android:orientation="vertical" android:layout_widt ="matc _parent"

android:layout_ eig t="wrap_content">

android:id="@+id/tv_title"

android:layout_widt ="wrap_content"

android:layout_ eig t="wrap_content"

android:textSize="12sp" />

android:id="@+id/tv_comment"

android:text="评论"

android:textSize="14sp"

android:layout_margin="5dip"

android:textColor="@color/colorAccent"

android:layout_widt ="wrap_content"

android:layout_ eig t="wrap_content" />

头部也很简单 就一张图片作为区分

android:layout_widt ="matc _parent" android:layout_ eig t="300dip">

android:layout_centerInParent="true"

android:layout_widt ="wrap_content"

android:layout_ eig t="wrap_content"

android:src="@mipmap/ic_launc er"/>

消息内容就以string作为信息数据类型 头的数据类型为 opClass

data class TopClass(val value: String)

实现一个adapter

class MainAdapter(private val beans: ArrayList, val context: Context) : RecyclerView

.Adapter() {

var eig t = 0

enum class TYPE(val value: Int) {

TOP(0), NORMAL

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。