<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                @EGOImageView是一個很常用的異步加載及緩存網絡圖片的第三方類,相比SDWebImage,個人感覺EGOImageView更簡單(PS:EGOImageView不支持ARC,SDWebImage3.0支持ARC) **@EGOImageView的導入** 1.下載:https://github.com/enormego/EGOImageLoading(下載后運行demo程序XCode會提示找不到EGOCache.h頭文件,可以在這個地方下載https://github.com/enormego/EGOCache) 2.將EGOCache、EGOImageButton、EGOImageView、EGOImageLoader全部添加到工程下(拷貝) 3.EGOImageView是不支持ARC的,在ARC的工程中要注意,可參考[MRC工程配置ARC](http://blog.csdn.net/hmt20130412/article/details/24036871) **@代碼示例:** ~~~ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. _button = [[HMTBlockButton alloc]initWithFrame:CGRectMake(110, 510, 100, 50)]; _button.backgroundColor = [UIColor redColor]; [_button setTitle:@"加載" forState:UIControlStateNormal]; [self.view addSubview:_button]; [_button release]; // 將系統給的Button封裝成了Block形式 _button.blockButton = ^(HMTBlockButton * button){ /** * placeholder.png 是圖片還未加載完成時顯示的圖片,在APP中經常能看到圖片未加載完成顯示是該APP主題的 * 圖片,當加載過程完成之后就會顯示url對應的圖片。 */ _imageView = [[EGOImageView alloc] initWithPlaceholderImage:[UIImage imageNamed:@"placeholder.png"]]; _imageView.imageURL = [NSURL URLWithString:@"http://i0.sinaimg.cn/ent/s/m/2011-08-19/U3904P28T3D3391507F329DT20110819143720.jpg"]; _imageView.frame = CGRectMake(60, 30, 200, 400); [self.view addSubview:_imageView]; [_imageView release]; }; // 作用:清除緩存 [[EGOCache globalCache] clearCache]; // 獲得已經下載了的圖片對象 UIImage * image = [[EGOImageLoader sharedImageLoader]imageForURL:[NSURL URLWithString:@"http://i0.sinaimg.cn/ent/s/m/2011-08-19/U3904P28T3D3391507F329DT20110819143720.jpg"] shouldLoadWithObserver:nil]; } ~~~ **@注意事項:** ? ? ? ? ?最近上網查資料看到,用EGOImageView的一個bug 當imageView的圖片加載完成了,這時你想換一個圖片的url并用EGOImageView加載這個圖片時,需要重新設置EGOImageView的imageURL屬性。**但是這里要特別注意的是這個方法必須在主線程中執行** ~~~ _button1 = [[HMTBlockButton alloc]initWithFrame:CGRectMake(160, 510, 100, 50)]; _button1.backgroundColor = [UIColor redColor]; [_button1 setTitle:@"換圖" forState:UIControlStateNormal]; [self.view addSubview:_button1]; [_button1 release]; // 將系統給的Button封裝成了Block形式 _button1.blockButton = ^(HMTBlockButton * button){ // 在主線程中進行 dispatch_async(dispatch_get_main_queue(), ^{ _imageView.imageURL = [NSURL URLWithString:@"http://www.sinaimg.cn/dy/slidenews/3_img/2012_10/28891_147237_598867.jpg"]; }); }; ~~~
                  <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>

                              哎呀哎呀视频在线观看