Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法只显示 CALayer 的部分内容?我试过使用 contentRect;但是,我不太确定它是否能按我的需要工作。假设我有一张图片,我只需要在用户将手指拖过图片时显示部分图片。contentRect 是要走的路吗?
你应该使用bounds财产
bounds
imageView.layer.bounds = CGRectMake(20, 20, 200, 200);