<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 圖層邊框 ??&nbp;?CALayer另外兩個非常有用屬性就是`borderWidth`和`borderColor`。二者共同定義了圖層邊的繪制樣式。這條線(也被稱作stroke)沿著圖層的`bounds`繪制,同時也包含圖層的角。 ??&nbp;?`borderWidth`是以點為單位的定義邊框粗細的浮點數,默認為0.`borderColor`定義了邊框的顏色,默認為黑色。 ??&nbp;?`borderColor`是CGColorRef類型,而不是UIColor,所以它不是Cocoa的內置對象。不過呢,你肯定也清楚圖層引用了`borderColor`,雖然屬性聲明并不能證明這一點。`CGColorRef`在引用/釋放時候的行為表現得與`NSObject`極其相似。但是Objective-C語法并不支持這一做法,所以`CGColorRef`屬性即便是強引用也只能通過assign關鍵字來聲明。 ??&nbp;?邊框是繪制在圖層邊界里面的,而且在所有子內容之前,也在子圖層之前。如果我們在之前的示例中(清單4.2)加入圖層的邊框,你就能看到到底是怎么一回事了(如圖4.3). 清單4.2 加上邊框 ~~~ @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; //set the corner radius on our layers self.layerView1.layer.cornerRadius = 20.0f; self.layerView2.layer.cornerRadius = 20.0f; //add a border to our layers self.layerView1.layer.borderWidth = 5.0f; self.layerView2.layer.borderWidth = 5.0f; //enable clipping on the second layer self.layerView2.layer.masksToBounds = YES; } @end ~~~ ![](https://box.kancloud.cn/2015-12-24_567bc1f209f05.png) 圖4.3 給圖層增加一個邊框 ??&nbp;?仔細觀察會發現邊框并不會把寄宿圖或子圖層的形狀計算進來,如果圖層的子圖層超過了邊界,或者是寄宿圖在透明區域有一個透明蒙板,邊框仍然會沿著圖層的邊界繪制出來(如圖4.4). ![](https://box.kancloud.cn/2015-12-24_567bc1f22f081.png) 圖4.4 邊框是跟隨圖層的邊界變化的,而不是圖層里面的內容
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看