SORU
11 AĞUSTOS 2011, PERŞEMBE


CALayer: sadece tek tarafı kenarlık ekleme

Bu şekilde bir CALayer kenarlık ekleyebilirsiniz

[webView.layer setBorderColor: [[UIColor colorWithRed:0.6 green:0.7 blue:0.2 alpha:1] CGColor]];
[webView.layer setBorderWidth: 2.75];   

Ama sadece tek taraflı bir sınır eklemek mümkün mü? Ben sadece alt kısmında bir sınır lazım. Ya ben diğer özellikleri, örneğin, çerçeve, sınır, maske ile bu ulaşmak,...?

enter image description here

Yardımlarınız için teşekkürler!


@- V Kontrol

        UIWebView *webView = [[UIWebView alloc] init];
        CALayer *webViewLayer = webView.layer;

        // now you can do a lot of stuff like borders:
        [webViewLayer setBorderColor: [[UIColor greenColor] CGColor]];
        [webViewLayer setBorderWidth: 2.75];    

CALayer, dokumentation bir göz atın: http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html

Ve şuna bir bak: http://iphonedevelopertips.com/cocoa/add-rounded-corners-and-border-to-uiwebview.html

CEVAP
20 Aralık 2011, Salı


Sağ kenarlık bunu kullanarak yaptım:

leftScrollView.clipsToBounds = YES;

CALayer *rightBorder = [CALayer layer];
rightBorder.borderColor = [UIColor darkGrayColor].CGColor;
rightBorder.borderWidth = 1;
rightBorder.frame = CGRectMake(-1, -1, CGRectGetWidth(leftScrollView.frame), CGRectGetHeight(leftScrollView.frame) 2);

[leftScrollView.layer addSublayer:rightBorder];

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • curioustravelers

    curioustrave

    12 AĞUSTOS 2006
  • Digital Bounds

    Digital Boun

    19 Temmuz 2013
  • SRI International

    SRI Internat

    30 NİSAN 2008