该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
1部分:
a.顶部是一个轮播,首先需要在build.gradle导入依赖implementation'com.youth.banner:banner:1.4.9'
使用标签
b.商品和评价那使用选项卡属性
android:layout_width="match_parent"
android:layout_height="36dp"
android:orientation="horizontal"
android:weightSum="2">
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="商品"
//标签同上
android:text="评价"
2部分:
3部分:分布主要是ListView标签
a.商品分类
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:ignore="UnknownId">
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="7">
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="商品分类"/>
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="46dp"
android:dividerHeight="1dp"/>
b.部分
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="3">
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"/>
android:layout_width="fill_parent"
android:layout_height="47dp"
android:layout_gravity="right|top"
android:orientation="vertical"
android:layout_marginLeft="3dp">
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical"/>
然后商品分类中再从数据库查询数据在TextView标签中显示。
效果展示:
