上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 75 下一页
摘要: 项目中有一个需求是让Checkbox居中显示,但是给checkBox直接设置 android:gravity="center" 属性无效,效果如下图: 可以看到,Checkbox中的图片仍然没有居中,后来找到了一种解决办法可以通过自定义CheckBox解决: package com.yongdaim 阅读全文
posted @ 2020-08-28 09:42 夜行过客 阅读(4213) 评论(0) 推荐(0) 编辑
摘要: requestLayout() View.requestLayout(); 调用该方法,控件会重新执行 onMeasure() , onLayout() 和 onDraw() 这三个方法。 layout() View.layout(int l, int t, int r, int b) 调用该方法会 阅读全文
posted @ 2020-08-26 17:06 夜行过客 阅读(599) 评论(0) 推荐(0) 编辑
摘要: 一. 背景知识 2013年谷歌i/o大会上介绍了两个新的layout: SlidingPaneLayout和DrawerLayout,现在这俩个类被广泛的运用,其实研究他们的源码你会发现这两个类都运用了ViewDragHelper来处理拖动。ViewDragHelper是framework中不为人知 阅读全文
posted @ 2020-08-25 15:29 夜行过客 阅读(1537) 评论(0) 推荐(0) 编辑
摘要: 今天在往Gerrit提交code时遇到了一个异常诡异的问题: ! [remote rejected] HEAD -> refs/for/master (no new changes) 开始我以为是本地的新commit已经提交到Gerrit上了,后来到Gerrit上一看没有,网上有好多的说法都是说:本 阅读全文
posted @ 2020-08-12 09:52 夜行过客 阅读(7601) 评论(0) 推荐(0) 编辑
摘要: 公司不让用VMware, 只好用VirtualBox, 安装好增强工具后,设置VirtualBox共享文件夹如下: 不过在linux(Ubuntu 16.04, Win10)中打开却提示:This location could not be displayed. You dont have the 阅读全文
posted @ 2020-08-03 10:22 夜行过客 阅读(11018) 评论(0) 推荐(1) 编辑
摘要: 原因: 在执行shell脚本时提示这样的错误主要是由于shell脚本文件是dos格式,即每一行结尾以\r\n来标识,而unix格式的文件行尾则以\n来标识。 查看脚本文件是dos格式还是unix格式的几种办法。(1)cat -A filename 从显示结果可以判断,dos格式的文件行尾为^M$,u 阅读全文
posted @ 2020-07-24 16:15 夜行过客 阅读(627) 评论(0) 推荐(0) 编辑
摘要: 有时在解决问题时,经常需要借助logcat才能分析定位问题,这里写了一个小工具,能够记录app运行期间的log, 这样测试人员在反馈bug时,只需要把logcat发给我们就可以了。具体代码如下: import android.content.Context; import android.conte 阅读全文
posted @ 2020-07-14 13:46 夜行过客 阅读(1964) 评论(0) 推荐(0) 编辑
摘要: 本文转自:https://www.ruanyifeng.com/blog/2020/04/git-cherry-pick.html 一. 概述 对于多分支的代码库,将代码从一个分支转移到另一个分支是常见需求。 这时分两种情况。一种情况是,你需要另一个分支的所有代码变动,那么就采用合并(git mer 阅读全文
posted @ 2020-07-14 10:28 夜行过客 阅读(591) 评论(0) 推荐(0) 编辑
摘要: 必要操作 找到“设置”--“开发者选项”,打开“启用蓝牙HCI信息收集日志”选项: 华为G9 Plus 打开cmd 窗口,输入:adb pull /data/log/bt 稍等片刻,日志就可以抓取出来了,抓取出来的btsnoop log 保存在当前用户的文件夹中(我的保存在C:\Users\nish 阅读全文
posted @ 2020-07-07 15:46 夜行过客 阅读(4043) 评论(1) 推荐(1) 编辑
摘要: 将指定的某一个比特位置0、置1、取反: /** * Set the specified bit to 1 * * @param originByte Raw byte value * @param bitIndex bit index (From 0~7) * @return Final byte 阅读全文
posted @ 2020-06-30 16:29 夜行过客 阅读(4643) 评论(0) 推荐(1) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 75 下一页