English 中文(简体)
采用CA Transform3的反索马里路线 DRotate
原标题:Anti-aliasing lines when using CATransform3DRotate

我从对。 为了达到以下形象,我如何运用一种观点来改变“国际观点”?。 然而,值得注意的是,分数线的斜线相隔。 难道不去做这种转变,以对付这些束缚的线索?

“entergraph

Edit I ve tried the solutions offered by DarkDust in the comments on this post. None seem to work. Here s 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 s 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 s 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;
    }

你在图像中看到的等级为:,Control,它们是直接分级表*Control* /levelView。

另有2个Dousk评论专门提到了我没有使用的UIImages。 如果它们仍然适用,而且有人可以解释如何执行,我肯定会向他们开枪。

问题回答

第7条载有一个新的财产编号<代码>allowsEdgeAntialiasingto CALayer,见rel=“nofollow”>here。 在安装到<代码>YES时,你的层将用反恐怖的边缘进行改造。

/* When true this layer is allowed to antialias its edges, as requested
 * by the value of the edgeAntialiasingMask property.
 *
 * The default value is read from the boolean UIViewEdgeAntialiasing
 * property in the main bundle s Info.plist. If no value is found in
 * the Info.plist the default value is NO. */

@property BOOL allowsEdgeAntialiasing;




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签