自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(47)
  • 资源 (1)
  • 收藏
  • 关注

原创 vue js 动态修改img src 属性

直接通过计算属性修改即可 <img :src = "playStyle"> //写法1 const playStyle = computed(()=> playing.value ?require(`@/assets/img/player/play.svg`) :require(`@/assets/img/player/stop.svg`) ) //写法2 computed:{ playStyle(){ 根据某个变化的值变换

2022-04-02 08:56:23 3228

原创 vue GET http://localhost:8080/undefined/ 404 (Not Found)(已解决)

/*我出现这种问题是因为:src =""动态使用图片链接,然而有时候链接是null(数据异步加载使得刚开始链接是空,后面才加载好导致这个问题)所以解决问题关键就是查看使用src的地方(stack overflow 也有这样类似的解答)*//*最后我给自己的图片链接加上*/this.songList.img?this.songList.img:""/* 当判断图片还没加载的时候默认为"" */......

2022-04-01 10:10:56 9211 8

原创 flex布局下组件内容居中

align-items:center; //可以使内容竖直居中 justify-content:center; //可以使内容水平居中 例子1.代码html代码: <div class = "flex-box"> <div class = "content-box">我就是内容模块</div> </div>css: .flex-box{ ...

2022-03-31 08:32:06 395

原创 css 文本溢出省略号

overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 示例 //html <div class = "message"> <div class = "title">一封情书给自己dddddddddddddddddddddddddddddddddddddddddd</div> <div class = "descripti...

2022-03-26 10:11:40 360

转载 vue 轮播图

因为是直接在html文件中实现直接复制到html运行即可,将图片地址修改,目录下要有vue.js文件基本参考了以下视频代码,并对其做了一些小改进以及注释https://www.bilibili.com/video/BV1RF411v77Z?spm_id_from=333.1007.top_right_bar_window_default_collection.content.click代码<!DOCTYPE html><html lang="en"><h.

2022-03-18 18:15:41 131

原创 Vue html组件中常用鼠标 触屏事件

1.鼠标事件1. @mouseleave:鼠标离开组件会触发事件,不会冒泡2. @mouseout:鼠标离开组件或者子组件会触发事件,会冒泡3. @mouseenter:鼠标进入组件时触发事件,不会冒泡4. @mouseover:鼠标进如组件时出发事件,会冒泡区别:mouseleave把组件当成整体,离开这个整体才会触发,离开子组件不触发(不冒泡)mouseout即使是离开组件的子组件也会触发(冒泡)mouseenter 与 mouseover 区别同上(进入)2.触摸事件

2022-03-17 22:58:21 1608

原创 Vue 3.0 配置自动补全路径

1.在项目下创建一个 vue.config.js 文件 内容如下const path = require("path"); //引入pathfunction resolve(dir){ //封装一个通用方法 return path.resolve(__dirname,dir);}module.exports = { chainWebpack:config=>{ config.resolve.alias .set("a

2022-03-14 17:05:37 1792

原创 Vue2.x中创建Toast插件并使用

一.首先创建toast文件夹文件夹里有Toast.vue文件 和index.js文件1.index.js如下import Toast from "./Toast";const obj = {}obj.install = function (Vue){ //1.创建组件构造器 const Construct = Vue.extend(Toast); //2.用new 的方式用组件构造器创建出来组件对象 const toast = new Construct(); //

2022-03-14 15:36:33 1731

原创 html给文字添加音标

<ruby> 好<rp>(</rp><rt>hao</rt><rp>)</rp> 日<rp>(</rp><rt>ri</rt><rp>)</rp> 子<rp>(</rp><rt>zi</rt><rp>)</rp> <.

2021-03-03 20:58:41 337 1

原创 Java面向对象程序设计大作业——学生信息管理系统

本代码原创 转载请声明包下载链接链接:https://pan.baidu.com/s/1ZEldcPE3xQw0aE4qCRC_5w提取码:d4rm扩展 贪吃蛇测试仅供参考 部分功能面向结果编程 1.登录界面 通过将用户输入的数据与数据文件对比,对用户身份进行识别,然后加以展示功能 (用户账号信息在Tool类中)1.公共功能学生只有两种功能:查询个人信息、修改密码1.查询个人信息2.修改密码1.教师功能 教师界面有查看个人信息、更.

2021-01-11 14:48:44 1778

原创 Fragment 动态切换碎片

// FragmentManager fragmentManager = getSupportFragmentManager();// FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();// fragmentTransaction.replace(R.id.right_layout,fragment);// fragmentTransaction.commi.

2021-01-10 20:03:58 121

原创 Fragment 碎片的使用

//需要有碎片类 //此处举例有左右两个碎片 //android:name="com.example.tabletproject.LeftFragment" //fragment 在布局中需要引入对应的类名(包名也要)//左碎片类public class LeftFragment extends Fragment { @Nullable @Override public View onCreateView(@NonNull LayoutInflater infla.

2021-01-10 19:46:03 71

原创 java 组件显示设置

jlabel.setBorder(BorderFactory.createLineBorder(Color.WHITE)) //设置边框线条 jbutton.setBorder(null) //无边框 jbutton.setContentAreaFilled(false)//透明

2020-12-16 21:16:43 273

转载 ImageView 中设置selector 不显示解决方法

原因:按压状态代码需要放在普通状态代码上方不显示代码<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <!--初始状态--> <item android:drawable="@mipmap/nav_me_normal"/> <!--按压状态--.

2020-12-13 22:01:07 260

原创 android studio 闪屏页实现

//可以让页面延迟两秒后启动第二个活动 //Handler类的方法 postDelayed(Runnable,long); Runnable:线程 long:页面停留时间ms myHandler.postDelayed(new Runnable() { @Override public void run() { //延迟时间2秒后运行此线程语句 从此活动跳转TwoActivity ...

2020-12-10 00:09:15 954

原创 前序、前中、中后序生成二叉树

中序后序生成树bitree In_rear_creatTree(char rear[],int rstart,int rend,char in[],int istart,int iend){//后中双遍历创造树 if(rstart > rend) return NULL; bitree t = new bitTree(); char ch = rear[rend]; //获得根结点 后序遍历的根结点在尾部 t->val = ch; //赋值 int i = 0;

2020-12-03 23:45:38 167

原创 android studio 报错No layout manager attached; skipping layout

说明没有使用layout manager完整使用 LinearLayoutManager layoutManager = new LinearLayoutManager(this); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); recyclerView.setLayoutManager(layoutManager); //使用管理器

2020-11-29 09:06:51 356

原创 android studio 使用.9.png出现AGPBI: {“kind“:“error“,“text“:“Android resource compilation failed“,“source

第一种: .9.png图只能(必须)画四条线,在画的过程中如果多画了线就会报此错误(如下图) 上、左线: 拉伸区 下、右线: 内容显示区 正确形式:第二种:文件名可能不符合标准 引用某网友所言 ...

2020-11-28 17:54:28 955

原创 android studio findViewById得到null

参考文章:https://www.cnblogs.com/therock/articles/3695016.html 网上找到的原因是:想要获得的控件不是本活动的layout 比如我创建的活动PersonActivity 一并生成的person_layout被我删掉 然后重新创建了一个 此时新layout与PersonActivity无关系 解决方法:先获得view 再用view调用findViewById View view = LayoutInflater.from

2020-11-28 11:06:20 331

原创 android studio RecycleView

首先在build.gradle文件下dependencies下添加如下代码首先在build.gradle 文件下dependencies下添加如下代码(添加依赖项) def recyclerview_version = "1.0.0" implementation "androidx.recyclerview:recyclerview:$recyclerview_version" implementation "androidx.recyclerview:recyclerview.

2020-11-24 22:59:18 114

原创 Java 多线程的两种实现方法

1.Thread类构造方法 Runnable target: //实现Runnable的对象 ThreadGroup group: //该线程所属的线程组 String name: //该线程的名字 如果name == null 系统会自动给线程设置一个唯一的名 public Thread(); public Thread(Runnable target); public Thread(ThreadGroup group,Runnable target); p

2020-11-22 19:05:41 74

原创 android studio 隐藏标题栏

在活动中添加下列语句//第一种// ActionBar actionBar = getSupportActionBar().hide();// if(actionBar !=null){//// actionBar.hide();//// }//第二种 getSupportActionBar().hide();

2020-11-21 19:45:42 109

原创 android studio ListView使用

class参考书籍《第一行代码》Fruit适配器public class FruitAdapter extends ArrayAdapter { private int resourceId; public FruitAdapter(@NonNull Context context, int textViewResourceId, List<Fruit> objects) { super(context,textViewResourceId,obje

2020-11-19 11:36:37 230

原创 android studio 自定义标题栏

加粗样式 代码解释 /* 需要动态加载标题栏,要用到LayoutInflater对象,LayoutInflater的from方法可以生成 LayoutInflater对象 然后用inflate方法调用布局,第一个参数是布局文件id, 第二个是已经加载好的布局的父布局,这里用TitleLayout */ LayoutInflater.from(context).inflate(R.layout.title_layout,this);TitleLayo

2020-11-15 11:40:55 907

原创 android studio百分比布局

PercentRelativeLayout 在build.gradle添加依赖库: implementation 'androidx.percentlayout:percentlayout:1.0.0' 代码解释: xmlns:app="http://schemas.android.com/apk/res-auto" 添加一个app命名空间 <?xml version="1.0" encoding="utf-8"?><androidx.percentlayout.wid

2020-11-14 17:54:52 800

原创 android studio 线性布局

LinearLayout 参考文章《第一行代码》 android:layout_weight="1" //占该行的权重(Button未设置)100% android:orientation="horizontal" //线性布局方向 horizontal vertical android:layout_width="match_parent" //宽度: match_parent(屏幕大小) wrap_content(组件够用) /* 当Li

2020-11-14 16:37:33 446

原创 android studio 部分控件代码

常用控件代码参考文章《第一行代码》/* gravity 作用:指定文本的对齐方式 gravity 参数:top buttom left right center 可多个结合: top|left center_vertical|horizontal_center 相当于 center maxLines 设定最大行数 在EditText(文本输入框)中使用当用户输入数据超过行时向上滚动 不会继续拉长*/ <EditText

2020-11-14 15:51:17 197

原创 android studio AlertDialog(提示框)

AlertDialog setTitle("AlertDialog"); 设置提示框的窗口标题 setMessage("确定删除?"); 设置提示信息 setPositiveButton("确定",new DialogInterOnClickListener(){}); setNegativeButton("取消",new DialogInterOnClickListener(){}) case R.id.button: AlertDialog.Builder dialo

2020-11-14 15:40:29 435

原创 android studio 设置ProcessBar(进度条)

ProcessBar (进度条)参考文章《第一行代码》参考文章: https://blog.csdn.net/hou09tian/article/details/80445141 /* 设置可见性: visible可见 View.VISIBLE invisible不可见但仍占用控件(类似透明但还在原位置) View.INVISIBLE gone不可见且不占用屏幕空间 View.GONE android:v

2020-11-14 11:41:23 1158

原创 android studio 一键退出所有活动

1.创建一个新类:ActivityCollector用于管理活动 活动继承 --- 在新类中用List存储新的活动 addActivity(Activity activity):添加新活动 removeActivity(Activity activity):退出指定活动 finishAll() :退出所有活动public class ActivityCollector { public static List<Activity> act

2020-11-13 20:52:45 716

原创 android studio 写相册

MainActivity函数package com.example.xml_and_java_layout;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;import android.view.ViewGroup;import android.widget.GridLayout;import android.widget.ImageView;public class MainActivit

2020-10-25 22:07:11 1152

原创 中值法快速排序

public static void quickSort(int left,int right,int nums[]){ if(left>=right){ return; } int i=left,j=right-1; int key=del(left,right,nums); while(i<j){ while(i<j&&nums[i]<=n..

2020-10-22 00:10:04 475

原创 android studio 绘制计算器UI

代码解释android:background="@drawable/shape_rectangle" 引用自己写的背景android:textSize="30sp" 字体大小android:gravity="center" 字体居正中android:gravity="center_vertical" 字体居竖直方向的中android:paddingLeft="50dp"

2020-10-14 21:21:01 163

原创 Linux环境下通过WordPress搭建个人博客

1.登录本例子(通过cmd登录) 代码: ssh 用户名@ip地址2.安装Apache HTTP服务yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql(1) 成功后启动Apache 服务systemctl start httpd.service(2) 检验Apache服务是否安装成功,浏览器输入http://ip地址显示此界面表示成功3.安装Mysql数据库wget http://d

2020-10-11 23:41:58 740 2

原创 android studio 帧布局

FrameLayout 帧布局android:background="@color/colorAccent" 背景颜色android:layout_gravity="center"/> 放置中间 <?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/

2020-10-10 22:36:06 559

原创 android studio 表格布局

TableLayout 表格布局应用于: 输入法 计算器等UI 演示代码<?xml version="1.0" encoding="utf-8"?><TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andro

2020-10-10 22:25:36 1801

原创 android studio 绝对布局

AbsoluteLayout 绝对布局绝对布局依靠坐标确定位置<?xml version="1.0" encoding="utf-8"?><AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <!-

2020-10-10 22:10:06 1310

原创 android studio 相对布局

RelativeLayout :相对布局1.基于父控件的布局基于父控件可将父控件理解成整个框架 控件默认在左边android:layout_centerInParent="true" 基于父控件中间(正中间)android:layout_alignParentRight="true" 基于父控件右边(右方)android:layout_alignParentBottom="true" 基于父控件下方(下方)演示代码<?xml version="1.0" enc

2020-10-10 21:54:12 316

原创 gradle-5.4.1-all.zip下载与替换

** gradle-5.4.1-all.zip文件群自取344386405 (非本人创建侵权删)**今天下载android studio 使用时出现出现错误:ERROR: Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-5.4.1-all.zip'.解决方法 1.将以下文件夹下的数据删掉 我的C:\Users\Hasee\.gradle\wrap

2020-10-07 22:48:08 12468

原创 链表 - 反转

1.先通过遍历链表找到尾节点(图中list.next) (该节点即反转后的头节点) 保存好该节点2.使尾节点的next指针指向前一个节点 并且断开前一个结点的next指针(赋null) list.next.next = list; list.next = null;3.重复2操作4.重复2操作;上代码:public ListNode reversalList(ListNode list){ if(list == null || list.nex

2020-09-28 23:49:20 991

Protel SE 试题&答案

大部分答案

2020-12-21

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除