gpt4 book ai didi

iphone - iPhone View 上的圆角

转载 作者:行者123 更新时间:2023-12-01 17:57:43 26 4
gpt4 key购买 nike

我想创建一个如下所示的 View 。
(您可能在 pinterest 和其他图片分享应用中看到过类似的图片格式)
会有很多(它们将是 tableview 或 collectionView 单元格)。

是否有创建 rounded effect 的首选方法? , shading effect有很多意见?

enter image description here

最佳答案

添加此框架

#import <QuartzCore/QuartzCore.h>

并使用以下代码,
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(15, 15, self.view.bounds.size.width - 30, self.view.bounds.size.height - 30)];
view.backgroundColor = [UIColor whiteColor];
view.layer.cornerRadius = 15.f;
view.layer.borderColor = [UIColor grayColor].CGColor;
view.layer.borderWidth = 2.f;
[self.view addSubView:view];

关于iphone - iPhone View 上的圆角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14356825/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com