I copied the code from the answer to How to apply perspective transformation to a UIView? to reach the next image. Pay attention, however, to jagged lines separating the levels. Is it possible to carry out such a transformation of perspective in such a way as to smooth out these jagged lines?

Edit I tried the solutions offered by DarkDust in the comments on this post. Nobody seems to be working. Here is my code:
levelView = [[UIControl alloc] initWithFrame:CGRectMake(100, 60, 160, 230)]; [self addSubview:levelView]; levelView.transform = CGAffineTransformScale(self.transform, .8, .8); CALayer *layer = levelView.layer; //DarkDust 2nd comment layer.borderWidth = 1; layer.borderColor = [[UIColor clearColor] CGColor]; CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; rotationAndPerspectiveTransform.m34 = 1.0 / 1000; rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, 45.0f * M_PI / 180.0f, 0.0f, 1.0f, 0.0f); layer.transform = rotationAndPerspectiveTransform; for (NSString *ID in [NSArray arrayWithObjects:@"Level 1", @"Level 2", @"Level 3", @"Level 4", @"Level 5", nil]) { //Note the offset of 5 from the superview in both X and Y directions. This addresses DarkDusk first comment UIControl *ctrl = [[UIControl alloc] initWithFrame:CGRectMake(5, y + 5, levelView.frame.size.width, 220/5)]; [levelView addSubview:ctrl]; [ctrl addTarget:self action:@selector(languageSelected:) forControlEvents:UIControlEventTouchDown]; [self styleEnabled:ctrl]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(13, 0, ctrl.frame.size.width - 13, ctrl.frame.size.height)]; [ctrl addSubview:label]; label.text = ID; label.font = [UIFont systemFontOfSize:20]; label.textColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:.8]; label.backgroundColor = [UIColor clearColor]; y += ctrl.frame.size.height; }
The level buttons that you see in the image are all instances of UIControl , and they are direct subzones of UIControl *levelView . levelView is the one that is being converted.
The other two DarkDusk comments are specific to UIImages, which I don't use. If they are still applicable, and someone can explain how to implement them, I will definitely give them a chance.
source share