SORU
15 NİSAN 2012, Pazar


nasıl üst-sol üst-sağ UİView köşesinde sadece konumuna taşır ayarlamak için?

Bir şekilde üst-sol üst-sağ UİView köşesinde sadece konumuna taşır set var mı?

DÜZENLEME:

Aşağıdaki denedim, ama manzarayı bir daha göremeyeceğim bu son. Bir şey aşağıdaki kod ile yanlış?

UIView *view = [[UIView alloc] initWithFrame:frame];

CALayer *layer = [CALayer layer];
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRoundedRect:frame byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight) cornerRadii:CGSizeMake(3.0, 3.0)];
layer.shadowPath = shadowPath.CGPath;
view.layer.mask = layer;

CEVAP
31 EKİM 2012, ÇARŞAMBA


Senin çözüm işe yaramadı neden emin değilim ama aşağıdaki kod benim için çalışıyor. Bezier bir maske oluşturmak ve görüntülemek için uygulayın. Benim kodda 3 piksel yarıçapı ile _backgroundView alt köşe yuvarlama yaptım. self 5 ** özel

UIBezierPath *maskPath;
maskPath = [UIBezierPath bezierPathWithRoundedRect:_backgroundImageView.bounds 
                                 byRoundingCorners:(UIRectCornerBottomLeft|UIRectCornerBottomRight) 
                                       cornerRadii:CGSizeMake(3.0, 3.0)];

CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.bounds;
maskLayer.path = maskPath.CGPath;
_backgroundImageView.layer.mask = maskLayer;
[maskLayer release];

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Baby Big Mouth

    Baby Big Mou

    5 Mart 2013
  • Kat Krazy

    Kat Krazy

    12 Kasım 2010
  • Lamborghini

    Lamborghini

    13 Aralık 2005