- 博客(12)
- 收藏
- 关注
原创 实现 图片+文字 一起居中显示的 Button
标签:```android:drawableLeft,android:drawableRight,android:drawableTop,android:drawableBottom;```但是如果使用上述标签,就会发现图标会贴着 Button 边缘,无法和文字一起居中。
2019-03-29 14:29:34
3773
4
原创 Java Stack类
Java Stack类简介:栈是 Vector 的一个子类,实现了一个标准的后进先出( last-in-first-out (LIFO))的栈。类继承结构:方法介绍:boolean empty() :判断栈是否为空E peek() :查看栈顶对象,不移除E pop() :返回栈顶对象,并移除E push(E item) :压入栈顶int search(Object o) :...
2019-03-16 17:09:40
366
原创 933. Number of Recent Calls
933. Number of Recent CallsWrite a class RecentCounter to count recent requests.It has only one method: ping(int t), where t represents some time in milliseconds.Return the number of pings that hav...
2019-03-12 23:29:23
287
原创 944. Delete Columns to Make Sorted
944. Delete Columns to Make SortedWe are given an array A of N lowercase letter strings, all of the same length.Now, we may choose any set of deletion indices, and for each string, we delete all the...
2019-03-12 22:30:13
243
原创 804. Unique Morse Code Words
804. Unique Morse Code WordsInternational Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: “a” maps to “.-”, “b” maps to “-…”, “c” maps t...
2019-03-10 23:26:52
202
原创 使用Python 快速搭建 HTTPServer 实现文件共享
SimpleHTTPServer是Python自带的一个HTTP服务类,通过使用该类,我们能够在任意平台(Linux, Windows, MacOS)快速搭建一个HTTP服务和共享服务。首先进入需要共享的文件夹:...
2019-03-06 10:05:11
954
原创 Android Fragment 生命周期及回调方法
Android Fragment 生命周期及回调方法1.概述基本概念:Fragment,简称碎片,片元。是Android 3.0(API 11)提出的,为了兼容低版本,support-v4库中也开发了一套Fragment API,最低兼容Android 1.6。support-v4库原本是一个jar包,24.2.0版本开始,将support-v4库模块化为多个jar包,包含:support-...
2019-03-05 23:11:31
6723
1
原创 使用Android studio 3.0.1实现简单计算器
计算器是日常常用的计算工具,此次介绍一种由Android studio实现的简易计算器,能够实现基本的加减乘除,删除和清空功能。实现效果图如下:首先介绍一下使用的资源文件:1.res -> values -> colors.xml文件,可以默认,可以自己加入颜色样本,只是为了方便色号对比和查询,可自行选择喜欢的颜色。<?xml version="1.0" e...
2018-07-31 09:28:52
4402
原创 LeetCode 693. Binary Number with Alternating Bits
693. Binary Number with Alternating BitsGiven a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.Example 1:Input:5
2017-12-12 21:41:49
259
原创 LeetCode 48. Rotate Image
48. Rotate ImageYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-place, which means you have to mo
2017-12-12 20:19:54
226
原创 LeetCode 56. Merge Intervals
56. Merge IntervalsGiven a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].思路分析:第一步:应当将所给的intervals排序,即需
2017-12-12 20:11:26
280
原创 LeetCode 728. Self Dividing Numbers
728. Self Dividing NumbersA self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0,
2017-12-12 19:51:43
235
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人