gpt4 book ai didi

iOS layer.borderWidth

转载 作者:行者123 更新时间:2023-11-29 10:37:19 26 4
gpt4 key购买 nike

UIView *view = [[UIView alloc]initWithFrame:CGRectMake(100,100,100,100)];
view.backgroundColor = [UIColor redColor];
view.layer.borderWidth = 1.0;
view.layer.borderColor = [UIColor blueColor].CGColor;
UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(-8, -10, 20, 20)];
image.image = [UIImage imageNamed:@"sample"];
[view addSubview:image];

图像在 View 上,但边界线是透明的・・・请告诉我如何解决这个问题。

最佳答案

尝试使用:

image.clipsToBounds = YES;

关于iOS layer.borderWidth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26229085/

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