简体   繁体   English

更改CGRectMake以在动画周围绘制圆

[英]Changing CGRectMake to draw a circle around animation

I am using that code to put an circle-animation with touch functions, but the result is that my animation is a circle and its 'closed' by black rectangle with black borders. 我正在使用该代码放置带有触摸功能的圆形动画,但结果是我的动画是一个圆形,并且被带有黑色边框的黑色矩形“封闭”。

Anim1 *anim1 = [[Anim1 alloc] initWithFrame:CGRectMake(15,45, 282, 282)];

how can i change it so it will be in a circle by the animation size? 我怎样才能改变它,使其与动画大小成一圈?

Well i found the answer... it's: 好吧,我找到了答案……是:

 [anim1.layer setBorderColor: [[UIColor brownColor] CGColor]];
 [anim1 setOpaque:NO];

The [anim1 setOpaque:NO] ; [anim1 setOpaque:NO] ; do all the work without it you get only colored background. 没有它就做所有工作,只会得到彩色背景。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM