iOS开发之坑1
发表于|更新于
|浏览量:
iOS开发之坑1
iOS 10 之后,switch的setOn方法调用之后,并没有按照文档上说的不发送action
https://stackoverflow.com/questions/39566361/uiswitch-seton-animated-does-not-work-as-document
遇到个诡异的问题,同样的创建view,然而在偶数列显示模糊,在奇数列正常
文章作者: 今是昨非
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 今是昨非的博客!
相关推荐
2021-07-23
Flutter组件基础——GridView
Flutter组件基础——GridViewGridView是网格布局,类似于iOS中的UICollectionView,可设置每行多少个、单个对象的宽高比、对象水平方向的间距、垂直方向的间距等等。 GridView的常用属性 GridView scrollDirection: 滑动方向 Axis.horizontal: 水平方向滑动 Axis.vertical: 垂直方向滑动,默认为这个。 padding: GridView相对于父视图的边距 crossAxisCount: 每行多少个 mainAxisSpacing: 与滑动方向垂直的方向的间距,eg: 当横向滑动时,这个代表垂直方向对象之间的间距; crossAxisSpacing: 与滑动方向平行的方向的间距,eg: 当横向滑动时,这个代表水平方向对象之间的间距; childAspectRatio:单个元素的宽高比(或者高宽比),当scrollDirection为vertical时,代表宽高比;当scrollDirection为horizontal时,代表高宽比。 简单使用代码如下: 1234567891011...
2022-03-29
更新:SDWebImage 添加 token
背景网上搜到的关于SDWebImage 添加 token,亦或者 SDWebImage add header的方法,都是直接使用SDWebImageDownloader中的setValue:forHTTPHeaderField:方法来设置。但是设置了之后笔者这边图片还是出不来,仔细研究后发现笔者这边的图片显示是先经过一次302跳转,然后跳转后才是真正的图片链接,第二次的这个链接是需要 token 的。 而直接设置SDWebImageDownloader的HTTPHeaderField设置到了第一个链接上面,302重定向后第二个链接的HTTPHeaderField仍是没有 token 解决方法一般来说,直接使用SDWebImageDownloader中的setValue:forHTTPHeaderField:方法设置即可。如下: 12345678- (void)addSDWebImageToken { SDWebImageDownloader *downloader = [SDWebImageDownloader sharedDownloader]; NS...
2022-04-14
Algorithem_MoveZeros
Algorithem_MoveZerosGiven an integer array nums, move all 0’s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Example 1: 1234Input: nums = [0,1,0,3,12]Output: [1,3,12,0,0] Example 2: 1234Input: nums = [0]Output: [0] 解法一实现逻辑: 首先把所有非0元素放到前面,并记录长度,最后从非0长度到数组尾部元素置为0 举例如下: 12345678910111213141516nums = [1, 0, 2, 3, 0, 6]j = 0 遍历数组:i = 0,nums[0] = 1, != 0, num[j] = num[i], j + 1, [1, 0, 2, ...
2021-07-26
Flutter布局基础——Stack层叠布局
Flutter布局基础——Stack层叠布局层叠布局适用于子视图叠放一起,且位置能够相对于父视图边界确认的情况。 比如,可用于图片上加文字,按钮上加渐变阴影等等。 Stack Widget的子视图要么是positioned,要么是non-positioned。Positioned子视图是指使用Positioned的widget包括起来的子视图,通过设置相对于Stack的top、bottom、left、right属性来确认自身位置,其中至少要有一个不为空。 Stack Widget的大小取决于所有non-positioned的子视图。non-positioned的子视图的位置根据alignment属性确定,(当alignment为left-to-right时,子视图默认从左上角开始;当aligment为right-to-left时,子视图从右上角开始;)。 Stack 基础使用Stack常用属性 Stack常用属性 children:子视图 alignment:子视图的对齐方式 topLeft:顶部左对齐 topCenter:顶部居中对齐 topRight:顶部右对齐 cent...
2022-04-21
Algorithem_Populating Next Right Pointers in Each Node
Algorithem_Populating Next Right Pointers in Each NodeYou are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: 123456struct Node { int val; Node *left; Node *right; Node *next;} Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Initially, all next pointers are set to NULL. Example 1: 12Input: root...
2024-11-19
Xcode使用免费的Codeium代码补全插件
背景在使用Xcode开发iOS应用时,经常需要编写大量的代码,而代码补全是提高开发效率的重要工具。Codeium是一款免费的代码补全插件,它可以帮助快速编写代码,提高开发效率。 如果有付费Copilot的,可以直接使用CopilotForXcode,之前公司有企业付费,所以用的这个工具,换公司后,不能用了,所以就想找一个免费的,虽然CopilotForXcode也包含有Codeium,但是却一直用不了。所以就想找一个能用Codeium的,参考 Codeium in Xcode ,起始项目是从CopilotForXcode中引出的,只为专门使用Codeium创建的,所以安装步骤和使用跟CopilotForXcode几乎一样。 使用安装步骤可以参考CodeiumForXcode,大致共有下面几个地方。 System Preferences ——> Privacy & Security ——> Accessibility中,将Codeium添加到列表中。如下图: General ——> Login Items & Extensions 中,将...
公告
This is my Blog