English 中文(简体)
1. 在其次目中从物体中建立圆点
原标题:Building a clip area in a UIView from path objects in its subviews

I m 试图在其次表中从物体中生成的电离层电离层。 例如,我可能有一个包含广场和一个圈子的子座。 我想能够在括号中产生一个lip子,把这两个形状的结合起来。 谁能解释如何做到这一点? 至今为止,我能看到的是:

1 - the superview s drawRect: method is called before its subviews drawRects are, and
2 - the ContextRef that s accessible in all three instances is the same.

Other than that I m stumped. Thanks,
Howard

最佳回答

简言之,你们必须通过所有次表加以调整,使每个人都能改变目前的背景道路,然后将这条道路作为一条lipp路。 你们可以要求从每一种观点出发,或者把背景传递给每一种观点。

CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState( context );
CGContextBeginPath( context );

for ( view in subviews ) {
  if ( [view respondsToSelector:@selector(pathTranslatedForView:)] ) {
    CGContextAddPath( context , [(MyCustomViewPath *)view pathTranslatedForView:self] );
  }
}

CGContextClip( context );
// do stuff with clipping path
CGContextRestoreGState( context );

Edit:

在提出分观点时,您不妨调整背景,以便0,0,即所谓的观点,而不是表面观点:

CGRect frame = [view frame];
CGContextTranslateCTM( context , -frame.origin.x , -frame.origin.y );
CGContextAddPath( context , [(MyCustomViewPath *)view path]; 
CGContextTranslateCTM( context , frame.origin.x , frame.origin.y );
问题回答

也许会试图确定背景的科罗·托查尔:调查意见——新陈词将消失,而只是走路。





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签