How could one create a circle that extends overtime. I want to do something like this:
[UIView animateWithDuration:5 animations:^(void){ /* Expand the circle */ // Get the contextRef CGContextRef contextRef = UIGraphicsGetCurrentContext(); // Set the border width CGContextSetLineWidth(contextRef, 1.0); // Set the circle fill color to Transparent CGContextSetRGBFillColor(contextRef, 0.0, 0.0, 0.0, 0.0); // Set the cicle border color to BLUE CGContextSetRGBStrokeColor(contextRef, 0.0, 0.0, 255.0, 1.0); // Fill the circle with the fill color CGContextFillEllipseInRect(contextRef, self.view.frame); // Draw the circle border CGContextStrokeEllipseInRect(contextRef, self.view.frame); }];
This drawing code will not affect the animation block.
Try instead:
// Create a view with a corner radius as the circle UIView* circle = [[UIView alloc] initWithFrame:CGRectMake(50, 50, 100, 100)]; [circle.layer setCornerRadius:circle.frame.size.width / 2]; [circle setBackgroundColor:[UIColor redColor]]; [self.view addSubview:circle]; [UIView animateWithDuration:5 animations:^{ // Animate it to double the size const CGFloat scale = 2; [circle setTransform:CGAffineTransformMakeScale(scale, scale)]; }];
Source: https://habr.com/ru/post/977799/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/977794/how-access-token-is-validated-for-accessing-protected-resources-in-token-based-mechanism&usg=ALkJrhgi38h4BzvIODGbX2he0u9EP3bKuwHow to destroy all instances of Bootstrap Popover? - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/977796/animate-uiviews-frame-and-corner-radius-together&usg=ALkJrhhY8-I1LKYiSoQeBFG9LbTH5wCdGwBootstrap carousel-fade no longer works with maxcdn 3.3.bootstrap.min.css - jquerySharing OAuth tokens through two Web API projects - c #Toggle button crashes in bootstrap navbar - twitter-bootstrapmocha with nodejs assert hangs / timeouts for assert (false) instead of error - javascriptJSP / GlassFish: how to properly configure UTF-8 encoding - javaUpdate node js packages on geroku - node.jsIs it possible to play YouTube videos on iOS without revealing / adding a presentation, but still following the YouTube Terms of Service? - iosAll Articles