iOS开发——扫码界面实现
发表于|更新于
|浏览量:
类似下面这样一个收款界面的实现
界面分析
- 黑色半透明背景
- navgationBar下面绿色的那个headerView
- 扫码框,及绿色动态扫码线的实现
- 扫码框下面的提示文字
黑色背景的实现,可能跟想象的不同,见下图(图中的1/2/3只是标识不同部分,不是顺序),先是需要放一个backView,然后是放中间的扫码框3,再然后上下左右四个1,最后放headerView和提示文字2;
实现
文章作者: 今是昨非
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 今是昨非的博客!
相关推荐
2023-02-22
CABasicAnimation进入二级界面再回来不生效
背景发现之前同事写的某个界面有个动效, 起初进入的时候是生效的, 进入二级界面再返回动效就没了, 动画用的是CABasicAnimation, 添加在 layer 上面. 解决看代码没有问题, 毕竟第一次就生效了, 以为是在页面消失时做了什么操作, 查了之后发现, 页面消失时并没有操作. 再回过来看代码, 代码动画部分是在didMoveToWindow中实现的, 大致如下: didMoveToWindow方法在页面消失和出现的时候都会调用, 难道是添加多次导致不生效了, 改成只添加一次之后发现效果一样, 进入二级页面再返回就不生效了. 1234567891011override func didMoveToWindow() { layer.addSublayer(gradientLayer) let basicAnim = CABasicAnimation(keyPath: "animateLocation") basicAnim.fromValue = [xxx] basicAnim.toValue = [xx...
2021-07-22
Flutter组件基础——ListView
Flutter组件基础——ListViewListView是滚动列表,类似于iOS中ScrollView,可横向、纵向滚动,内容不限。 ListView的使用ListView的使用很简单,但是需要多多练习; ListView的使用,通过设置children来实现,children中的Item为Widget对象。 纵向滚动代码如下: 123456789101112131415161718192021222324252627282930313233343536373839class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'ListView Learn', home: Scaffold( appBar: new AppBar( tit...
2025-09-25
Xcode 26 接入QWen
第一步,注册阿里云百炼账号首先需要一个阿里云百炼的账号,打开后,切换到API参考,按照上面获取API Key的步骤,操作开通,并获取到API Key。 第二步,添加Provider到Xcode 26然后打开Xcode 26,打开设置,选中”Intelligence”,点击添加,如下图 然后会进入输入信息界面,共有4个信息需要输入,URL、API Key、API Key Header、Description,如下图: URL:https://dashscope.aliyuncs.com/compatible-mode/API Key:==Bear 你自己的APIKey==API KeyHeader: ==Authorization==Description: 这个名字自己定义 这里需要注意的是,如果按照阿里云百炼上提示的,URL配置为 https://dashscope.aliyuncs.com/compatible-mode/v1,点击Save的时候就保存不了,所以需要去掉v1。 点击Save之后,能看到自己开通的所有Models列表,说明成功,如下图。 第三步,使用...
2023-03-31
Xcode 14.3 Archive 失败
背景由于手机升级了iOS 16.4,想要真机调试,Xcode 也要升级到 14.3, 于是就升级了一下。 升级Xcode 14.3之前,Debug 和 Archive 都没问题;升级 Xcode 14.3之后,Debug 没问题,Archive 就报错。错误信息如下: 123456789building file list ... rsync: link_stat "/Users/xxx/.../AFNetworking.framework" failed: No such file or directory (2)donesent 29 bytes received 20 bytes 98.00 bytes/sectotal size is 0 speedup is 0.00rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/9e200cfa-7d96-11ed-886f-a23c4f261b56/Librar...
2022-04-15
Algorithem_TwoPointers
Algorithem_TwoPointersTwo Sum II - Input Array Is SortedGiven a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 <= numbers.length. Return the indices of the two numbers, index1 and index2, added by one as an integer array [index1, index2] of length 2. The tests are generated such that there is e...
2019-01-03
Xcode插件的实现-JSON格式化
背景:开发中经常遇到需要格式化JSON字符串的情况,每次都是百度在线格式化解析好不方便,某天看到APP Store里有Xcode关于这个的插件,卖的老贵了,哈哈哈,于是就想自己也弄一个,先调研一下JSON格式化的实现原理,然后再看看Xcode插件的实现,最后还可以写个Mac版,给自己大大的赞😄
公告
This is my Blog