相关疑难解决方法(0)

CALayer:仅在一侧添加边框

我可以用这种方式为CALayer添加边框:

[webView.layer setBorderColor: [[UIColor colorWithRed:0.6 green:0.7 blue:0.2 alpha:1] CGColor]];
[webView.layer setBorderWidth: 2.75];   
Run Code Online (Sandbox Code Playgroud)

但是,是否可以仅在一侧添加边框?我只需要底部的边框.或者我可以用其他属性来达到这个目的,例如框架,边界,面具,......?

在此输入图像描述

谢谢你的帮助!


b控制-V

        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];    
Run Code Online (Sandbox Code Playgroud)

请查看CALayer文档:https: //developer.apple.com/documentation/quartzcore/calayer

看看这里:http: //iosdevelopertips.com/cocoa/add-rounded-corners-and-border-to-uiwebview.html

iphone core-animation objective-c calayer

62
推荐指数
5
解决办法
6万
查看次数

标签 统计

calayer ×1

core-animation ×1

iphone ×1

objective-c ×1