首页 > 其他分享 >2022-11-9学习内容

2022-11-9学习内容

时间:2022-11-09 22:49:11浏览次数:47  
标签:11 xml shopping 私有 购物车 学习 2022

1.案例-购物车-数据库准备

1.1MyApplication.java

改为内部存储私有空间

// 内部存储私有空间
        String directory = getFilesDir().toString() + File.separatorChar;

1.2效果:

 验证:

2.案例-购物车-商品列表展示

2.1 shape_oval_red.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">

    <solid android:color="#ff6666" />

</shape>

2.2title_shopping.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:background="#aaaaff">

    <ImageView
        android:id="@+id/iv_back"
        android:layout_width="50dp"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:src="@drawable/ic_back" />

    <TextView
        android:id="@+id/tv_title"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignParent="true"
        android:gravity="center"
        android:textColor="@color/black"
        android:textSize="20sp" />

    <ImageView
        android:id="@+id/iv_cart"
        android:layout_width="50dp"
        android:layout_height="match_parent"
        android:layout_alignParentRight="true"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:src="@drawable/cart" />

    <TextView
        android:id="@+id/tv_count"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@+id/iv_cart"
        android:layout_marginLeft="-20dp"
        android:gravity="center"
        android:background="@drawable/shape_oval_red"
        android:text="0"
        android:textColor="@color/white"
        android:textSize="15sp" />

</RelativeLayout>

1.3activity_shopping_channel.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/orange"
    android:orientation="vertical">

    <include layout="@layout/title_shopping" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <GridLayout
            android:id="@+id/gl_channel"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:columnCount="2" />
    </ScrollView>


</LinearLayout>

 

标签:11,xml,shopping,私有,购物车,学习,2022
From: https://www.cnblogs.com/pingfanliliang/p/16871949.html

相关文章

  • MySql - 基础学习5 - select
    一.分页和排序--分页limit和排序orderby--排序;升序ASC,降序--升序SELECTs.`id`,`name`,`paw`,`gradename`FROMstudentASsINNERJOINgradeAS......
  • luffy学习-05
    一、协同开发在公司中,都是多人共同开发同一个项目组长本地创建出空项目,底层代码写完——>提交到远程仓库和同事们张三李四王麻子都要共同开发这个项目我们要把代码clo......
  • 2022.11.9
    ###noip模拟为什么一点儿进步都没有啊。。。怎么还越来越菜了。。。。。。  ##出错点t1:MLE。。。。。。也是挺牛t4://intans=0;longlongans=0;//n*n啊不......
  • CSP-S2022 总结
    调整了下心态开考顺序开题看完\(T1,T2\)直接开打\(T2\)的线段树,还是比较好写的然后思考先打\(T1\)呢还是拍\(T2\),最后决定拍\(T2\),稳一点发现随机数据很弱,决定......
  • [转载学习] Verilog-SystemVerilog中的force和release语法
    Verilog-SystemVerilog中的force和release语法本文属于转载,版权属于原博主—狮子座硅农(LeoICer)&星星在人间,博客原地址https://blog.csdn.net/qianniuwei321/article/de......
  • 【2022-11-09】luffy项目实战(四)
    一、前台首页组件编写#HomeView.vue页面组件#Header.vue头部组件#Banner.vue轮播图组件#Footer.vue尾部组件1.1HomeView.vue<template><divcla......
  • 【人工智能】机器学习入门之监督学习(一)有监督学习
    机器学习入门之监督学习(一)有监督学习简介监督学习算法是常见算法之一,主要分为有监督学习和无监督学习。本文主要记录了有监督学习中的分类算法和回归算法,其中回归算法是......
  • #yyds干货盘点#【愚公系列】2022年11月 微信小程序-导航(跳转)
    前言1.navigatornavigator是页面跳转的标签,具体参数如下:属性类型默认值必填说明最低版本targetstringself否在哪个目标上发生跳转,默认当前小程序2.0.7......
  • 广告行业中那些趣事系列54:从理论到实践学习当前超火的多模态学习模型
    导读:本文是“数据拾光者”专栏的第五十四篇文章,这个系列将介绍在广告行业中自然语言处理和推荐系统实践。本篇从理论到实践介绍了当前超火的多模态学习模型,想了解多模态学习......
  • 【前端】学习前端vue框架,了解了什么是v-model
    什么是v-model呢?v-model指令可以在表单input、textarea及select元素上创建双向数据绑定。它会根据控件类型自动选取正确的方法来更新元素。尽管有些神奇,但v-model本......