草庐IT

clipsToBounds

全部标签

ios - 分组的 UITableViewCell 中的 clipsToBounds 和 masksToBounds

我试图让我的UITextView的角被包含它的分组UITableViewCell的圆角遮盖。这是当前单元格的屏幕截图这是我用来防止角与单元格边界重叠的一些代码。我都试过了cell.contentView.layer.masksToBounds=YES;cell.layer.masksToBounds=YES;//triedthisasatest,stilldoesn'tworkdetailTextView.clipsToBounds=YES;[cell.contentViewaddSubview:detailTextView];和cell.layer.masksToBounds=YES

android - Android 在 iOS 上有像 clipsToBounds 这样的属性吗?

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。要求提供代码的问题必须表现出对所解决问题的最低限度理解。包括尝试过的解决方案、为什么它们不起作用,以及预期结果。另请参阅:StackOverflowquestionchecklist关闭8年前。ImprovethisquestionAndroid有没有类似iOS上的clipsToBounds的属性?用于在父View的边界之外显示subview?

ios - clipsToBounds 导致 UIImage 在 iOS10 & XCode 8 中不显示

我将我的项目切换到iOS10和XCode8的新测试版。在我使用的应用程序的所有三个区域中:imageView.layer.cornerRadius=imageView.frame.size.width/2imageView.clipsToBounds=true相关图像根本不显示。我尝试清理项目和构建文件夹,重新启动设备,尝试各种模拟器,重新添加imageView,以编程方式设置关联的UIImage而不是从Assets中选择一个。无论masksToBounds是true还是false,删除clipsToBounds行都会显示矩形图像。如何在XCode8/iOS10中制作圆形图像?编辑:该

ios - UIView 的 clipsToBounds 和 CALayer 的 masksToBounds 是什么关系?

UIView有一个CALayer。这是很确定的。但两者似乎都提供了一些意义相同的东西。如果我设置了clipsToBounds=YES,这是否也会设置层的masksToBounds=YES?为什么不同的名字?有人知道吗? 最佳答案 它们是不同的名称,因为UIView和CALayer不同并且具有不同的相关术语,但它们在功能上是等价的。如果反汇编clipsToBounds,您会看到它只是调用masksToBounds(从模拟器框架反汇编,所以x86):-(BOOL)[UIView(Rendering)clipsToBounds]+0309

ios - clipsToBounds 如何工作?

我想知道如何使用UIView属性clipsToBounds。官方文档是这样说的:clipsToBoundspropertyABooleanvaluethatdetermineswhethersubviewsareconfinedtotheboundsoftheview.DiscussionSettingthisvaluetoYEScausessubviewstobeclippedtotheboundsofthereceiver.IfsettoNO,subviewswhoseframesextendbeyondthevisibleboundsofthereceiverarenotclip

带有 xcode 8 GM 的 iOS 10 GM 由于 roundedCorners 和 clipsToBounds 导致 View 消失

我使用iOS10Beta7和Xcode8beta测试了我的应用,一切正常。然而,就在几分钟前,我安装了现在可用的GM版本,但遇到了一个奇怪的问题。我在我的应用程序中使用自定义表格View单元格,在我的自定义单元格中我使用cornerRadius和clipsToBounds来创建圆角View。-(void)awakeFromNib{[superawakeFromNib];self.tag2label.layer.cornerRadius=self.tag2label.frame.size.height/2;self.tag2label.clipsToBounds=YES;}这在之前看起来
12