当前位置: 首页 > 新闻动态 > 软件编程

微信小程序个人中心的列表控件实现代码

作者:用户投稿 浏览: 发布日期:2026-01-11
[导读]:这篇文章主要介绍了微信小程序个人中心的列表控件实现代码,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

个人中心的列表控件

首先来看效果图

wxml

<view class="list-item">
 <image class="item-image" src="../images/fuwu.png"></image>
 <text class="item-text">我的收藏</text>
 <image class="image-jiantou" src="../images/jiantou.png"></image>
 </view>
 <view class="line"></view>

wxss

.list-item {
 display: flex;
 flex-direction: row;
 align-items: center;
 width: 100%;
 height: 80rpx;
 margin-top: 10rpx;
 position: relative; /*父元素位置要设置为相对*/
}

.item-image {
 width: 50rpx;
 height: 50rpx;
 margin: 20rpx;
}

.item-text {
 color: gray;
 font-size: 35rpx;
 margin-left: 20rpx;
}

.image-jiantou {
 width: 20rpx;
 height: 35rpx;
 position: absolute; /* 要约束所在位置的子元素的位置要设置成绝对 */
 right: 0; /* 靠右调节 */
 margin-right: 35rpx
}

.line {
 width: 100%;
 height: 3rpx;
 background: lightgray;
 margin-left: 90rpx;
}
免责声明:转载请注明出处:http://sczxchw.cn/news/531196.html

扫一扫高效沟通

多一份参考总有益处

免费领取网站策划SEO优化策划方案

请填写下方表单,我们会尽快与您联系
感谢您的咨询,我们会尽快给您回复!