在class 组件中,我们需要在 componentDidMounted 里面给 mp3 加上监听,然后在 组件销毁的时候 去掉监听。 来控制 mp3 的播放和暂停。相对来说比较麻烦。难以抽离。 这里用 hooks 达到完全抽离的效果: interface IAudioProps extends R ...
分类:
其他好文 时间:
2021-05-24 07:45:22
阅读次数:
0
注解和反射 1.内置注解 package com.yu.annotation;?import java.util.ArrayList;?//什么是注解public class Test01 extends Object{?? // @Override 重写的注解 @Override public S ...
分类:
其他好文 时间:
2021-05-24 06:38:42
阅读次数:
0
Super关键字的三种用法 在子类的成员方法中,访问父类的成员变量。 public class Fu { int num = 10; } public class Zi extends Fu { int num = 20; public void methodZi() { System.out.pr ...
分类:
其他好文 时间:
2021-05-24 05:28:29
阅读次数:
0
Handler基本使用 public class MainActivity extends AppCompatActivity { /** * 这里的list如果不使用handler,由于是网络资源,加载需要时 间, 在当我们进行加载ui是 * 很可能list为空,或者没有全部加载完成 */ pri ...
分类:
移动开发 时间:
2021-05-24 05:06:21
阅读次数:
0
this.(解决成员变量的局部变量的重名问题) this()(是用来调用本类中其他的构造方法) super.(调用父类中的成员变量或者成员方法) super() (调用父类的中的构造方法) //想要调用本类中的其他构造方法又想要调用父类的构造方法就要先调用本来的有参构造再在调用的有参构造里调用父类的 ...
分类:
其他好文 时间:
2021-05-24 03:50:43
阅读次数:
0
Super Palindromes (H) 题目 Let's say a positive integer is a super-palindrome if it is a palindrome, and it is also the square of a palindrome. Given tw ...
分类:
其他好文 时间:
2021-05-24 02:27:55
阅读次数:
0
##1、图片按钮 import java.awt.*; import javax.swing.*; import java.net.URL; public class JButtonDemo01 extends JFrame{ public JButtonDemo01() { Container c ...
1.首先创建一个自定义View类: public class CustomView extends ViewGroup { private int mleftMargin=20; private int mtopMargin=20; public CustomView(Context context ...
分类:
移动开发 时间:
2021-05-03 12:48:19
阅读次数:
0
Mysql配置读写数据库 ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation 原因之前mysql的vi /etc/my.cnf 修改配置没有重启 ...
分类:
其他好文 时间:
2021-04-30 12:42:22
阅读次数:
0
先看代码 package com.zyt.jvmbook; public class Girl extends Person{ public Girl() { int a; } @Override public void sayHello() { System.out.println("girl s ...
分类:
其他好文 时间:
2021-04-28 11:53:27
阅读次数:
0