<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          GDRSImageCacheiOS 圖片緩存庫

          聯(lián)合創(chuàng)作 · 2023-09-26 03:53

          GDRSImageCache 是 iOS 一個(gè)非常小型的圖片緩存和更改圖片大小的開發(fā)包。給定一個(gè) URL 后該庫會(huì)通過后臺(tái)線程獲取圖片并在內(nèi)存中緩存。

          使用方法:

          UIImageView *anImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
          
          // create the cache
          GDRSImageCache *cache = [[GDRSImageCache alloc] initWithCachedImageFilter:^UIImage *(UIImage *sourceImage) {
          
              // resize the image to the image view size and round the image corners; 
              // this is called by the cache on a background thread
              return [sourceImage gdrs_resizedImageToAspectFitSize:anImageView.bounds.size cornerRadius:10];
          
          }];
          
          // set the default image, which will be returned from
          // fetchImageWithURL:completionHandler: if an image coresponding to the
          // requested url is not cached yet.
          cache.defaultImage = [UIImage imageNamed:<#place holder image name#>];
          
          
          NSURL *imageUrl = <#an url to a image#>;
          
          // fetch an image; the call returns imidiatly and the callback handler
          // is called when the image is fetched over the network
          anImageView.image = [cache fetchImageWithURL:imageUrl completionHandler:^(UIImage *image, NSError *error) {
              anImageView.image = image;
          }];
          瀏覽 24
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  日韩在线,欧美,国产在线 | 成人鸡巴视频 | 思思热免费 | 日本一级婬片A片AAA毛片男男 | 在线看的黄片网站 |