![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
UI
sanjieshenwu1987
这个作者很懒,什么都没留下…
展开
-
【iOS】UITextField 的 UIKeyboardType
1、默认样式case `default` = 0 // Default type for the current input method.2、ASCII 码键盘case asciiCapable = 1 // Displays a keyboard which can enter ASCII characters3、数字和标点符号case numbersAndPunctuation = 2 // Numbers and assorted punctuation.4、URL键盘ca原创 2021-11-11 11:11:28 · 2012 阅读 · 0 评论 -
【诡异】有些bug很bug
1、点击无效在模拟器 iPhone 12 上调试,突然发现一个页面的点击效果不响应,试了其他模拟器都可以;打断点看页面也没有出界,在有效视图内,布局正常,就是不响应点击事件。偶然点到顶部发现响应了,其他位置不响应。放了两天再打开启动点击,一切正常。。。2、还是上面那个页面,有个顶部布局的view高度似乎自适应设备变化,代码里没有这么设计啊,找到下班也没找到,其他视图布局在这个视图底部尺寸位置都是正常的,上面那个视图会覆盖一部分其他视图。过了个周末再调试,一切正常。。。 我勒个去。...原创 2021-10-11 09:58:02 · 164 阅读 · 0 评论 -
【iOS】深色模式适配记录
注:1、iOS13开始支持深色模式;2、xib无法适配iOS13之前的版本,只能把要设置颜色的控件连线到代码中,代码控制颜色;3、使用的 LLDark 库实现适配;原创 2021-09-27 16:04:00 · 434 阅读 · 0 评论 -
【问题记录】UIImageview添加遮罩后不显示图片
iPhone Xs Max 14.5预期效果图给UIImageview添加一个气泡框样式的遮罩图,使图片加载后显示为气泡框样式。原代码: //设置蒙版遮罩层通道 UIImageView *imageViewMask = [[UIImageView alloc] initWithImage:image]; imageViewMask.frame = CGRectInset(view.frame, 0.0f, 0.0f); view.layer.mask = imageViewMask.laye原创 2021-05-07 16:51:21 · 762 阅读 · 0 评论 -
ios-在视图上挖个洞
view背景为黑色半透明,右下角挖一个矩形显示底部图层。 _tapView = [[UIView alloc] initWithFrame:self.view.bounds]; _tapView.backgroundColor = [UIColor colorWithWhite:0 alpha:.5]; // 贝塞尔绘制区域 UIBezierPath *path = [UIBezierPath bezierPathWithRect:self.view.bo原创 2020-07-24 10:14:39 · 1026 阅读 · 0 评论 -
iOS UITableViewCell 高度自适应的解决方案
// 设置预加载cell高度 tableView.estimatedRowHeight = 55; // 自动适应cell高度 tableView.rowHeight = UITableViewAutomaticDimension;或者- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 55;}- (C.原创 2020-06-23 09:16:51 · 4835 阅读 · 2 评论 -
iOS禁用深色模式
设置默认不使用深色模式info.plist<key>UIUserInterfaceStyle</key> <string>Light</string>原创 2020-06-23 09:13:28 · 1242 阅读 · 0 评论 -
获取view的坐标最大值
在布局的时候,想要在view的左边或下边布置另一个view,可以使用CGRectGetMaxX和CGRectGetMaxY来获取第一个view的坐标,来布局另一个view的origin(原点)UIView *view = [[UIView alloc] init]; [self.view addSubview:view]; [view mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(se原创 2020-06-22 16:59:05 · 1087 阅读 · 0 评论 -
UIView 设置阴影
// view背景色不能为[UIColor clearColor],否则阴影不显示 view.backgroundColor = [UIColor whiteColor]; // 阴影颜色 view.layer.shadowColor = [UIColor blueColor].CGColor; // 阴影半径,默认是3 view.layer.shadowRadius = 3; // 阴影偏移,默认是CGSizeMake(0, 3)。 // C...原创 2020-06-22 16:46:20 · 580 阅读 · 0 评论