代码改变世界

Android模拟器无法安装支付宝正式版,只能装沙箱版

2023-05-26 17:06 by 法子, 610 阅读, 0 推荐, 收藏, 编辑
摘要:支付宝闪退或卡死属于软件商限制问题,目前所有模拟器均存在此现象。只能装沙箱版来调试。 阅读全文

uni-app 无法清空input,即无法更新 UI

2023-04-24 10:23 by 法子, 662 阅读, 0 推荐, 收藏, 编辑
摘要:<input :value="inputValue" @input="handleInput"/> handleInput ({detail}) { // 没有这一行会导致第二次无法清空 input this.inputValue = detail.value }, handleClickClear 阅读全文

数字转两位小数金额

2022-08-05 10:25 by 法子, 56 阅读, 0 推荐, 收藏, 编辑
摘要:function formatCount(count) { var string = String(count || 0) if (!string) { return '' } var index = string.indexOf('.') if (index != -1) { string += 阅读全文

Guideline 5.1.1

2022-07-12 10:00 by 法子, 160 阅读, 0 推荐, 收藏, 编辑
摘要:参考:https://blog.csdn.net/q1664532726/article/details/114303489 iOS提交App Store Connect审核,因为付费内容需要用户先登录被拒,意思是付费就付费,干嘛要用户手机号。内容如下: 我回复了两条。重新提交之后过审了。 第一条是 阅读全文

正则:匹配除了最后一个之外的所有点

2022-02-24 15:33 by 法子, 37 阅读, 0 推荐, 收藏, 编辑
摘要:'1.2.3.4.5.mp3'.replace(/\.(?=.*\.)/g, '') 输出:'12345.mp3' 阅读全文

新的ViewController半透明显示下面的ViewController

2021-03-01 18:14 by 法子, 186 阅读, 0 推荐, 收藏, 编辑
摘要:参考:https://www.jianshu.com/p/a8b53a126014 关键设置:self.modalPresentationStyle = UIModalPresentationOverCurrentContext;然后把新ViewController的背景色设为半透明:self.vi 阅读全文

重用Cell里的UIActivityIndicatorView会停止

2021-01-14 17:36 by 法子, 272 阅读, 0 推荐, 收藏, 编辑
摘要:参考:https://stackoverflow.com/questions/28737772 如果UICollectionViewCell或者UITableViewCell里面有UIActivityIndicatorView,重用机制下的cell里UIActivityIndicatorView的转 阅读全文

UICollectionView registerClass

2021-01-07 13:41 by 法子, 371 阅读, 0 推荐, 收藏, 编辑
摘要:UICollectionView的方法registerClass,如果调用会使注册的cell类在xib或storyboard里的相关内容失效。比如你在storyboard里为这个cell类加了一个button,那么实际上不会显示。 // If a class is registered, it wi 阅读全文

正则:字符串除了后四位之外其余替换成星号

2020-12-09 15:50 by 法子, 1343 阅读, 0 推荐, 收藏, 编辑
摘要:'18589096794'.replace(/.(?=.{4})/g, '*') 输出:*******6794'18589096794'.replace(/(?<=.{3}).(?=.{4})/g, '*') 输出:185****6794 阅读全文

没有git commit代码就切换了分支之后找回代码

2020-11-17 17:21 by 法子, 1670 阅读, 0 推荐, 收藏, 编辑
摘要:参考:https://www.cnblogs.com/xzdm/p/11064514.html 1.git stash list查看暂存列表,最近的一次暂存是stash@{0}。(查看暂存修改内容git show stash@{0}) 2.git stash apply stash@{0} 取出暂存 阅读全文