広告デザインをウォームアップ

需要のポイント:
1、一方向の圧延図。
画像がロードされた後2、カウントダウンが始まります
4、ネットワーク要求の写真、すべての画像のリクエストがロードされたネットワークを完了した後に
比較例5は、拡大画像の要件は、トップは\ \右その容器左
 
問題領域:
画像内のシステムを追加するUIImageView方法:鱗片状パターン、画像のみを中心に、遠藤。
他のモードも、必要な効果未満まで追加します。
 
デザイン:
contentSizeは画像の数に基づいて計算し、コンテナの外で行うページを開きScrollView。
カスタムHDImageViewは、ImageViewのサイズ及びダウンロード容器の画像のアスペクト比から算出したアスペクト比、内部UIImageViewを追加し、レイアウトフットプリントのため、のUIViewから継承しました
次のようにコードは次のとおりです。
 
- (ボイド){customLayoutSubviewsの
    dispatch_async(dispatch_get_main_queue()、{^
       
        //フレームのアスペクト比がImageViewの画像の内部に設けられている
       
        CGSize IMAGESIZE = self.image.size;
        CGSize containerSize = self.frame.size;
       
        CGFloat imageHeightWithScale = IMAGESIZE。高さ/ imageSize.width;
        CGFloat innerImageViewWith;
        CGFloat innerImageViewHeight、
        画像より//細長い容器
        IF(imageHeightWithScale> containersize.height / containerSize.width){
            //コンテナの幅を維持一貫
            ; innerImageViewWith = containerSize.width
            innerImageViewHeight = innerImageViewWith * imageHeightWithScale ;
        }他{
            //保持高度与容器一致
            innerImageViewHeight = containerSize.height。
            innerImageViewWith = innerImageViewHeight / imageHeightWithScale。
        }
        self.innerImageView.frame = CGRectMake(0、0、innerImageViewWith、innerImageViewHeight)。
    });
   
}
 
 
 

おすすめ

転載: www.cnblogs.com/huaida/p/11247047.html
おすすめ