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

          HUAutoLayoutiOS布局自動排版

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

          HUAutoLayout

          根據(jù)給定的數(shù)據(jù)量,進(jìn)行自動排版.

          使用方法

          實例化布局對象

            HUAutoLayout *layout = [HUAutoLayout sharedLayout];

          為布局對象賦值

            NSUInteger culomn;               //!< 屬性描述: 列數(shù)  
            NSUInteger line;                 //!< 屬性描述: 行數(shù)
            UIEdgeInsets contentInset;       //! <屬性描述: 內(nèi)邊距
            CGFloat minimumInteritemSpacing; //!< 屬性描述: 列間距
            CGFloat minimumLineSpacing;      //!< 屬性描述: 行間距
            CGSize itemSize;                 //!< 屬性描述: 尺寸

          九宮格自動布局

            - (void) hu_layoutSquare:(UIView *)targetView layoutCount:(NSInteger)count layoutType:(HUAutoLayoutSquareType)type handleBlock:(HUAutoLayoutHandleBlock)handleBlock;
          • 垂直方向上流水布局 必須設(shè)定 itemHeight, culomn 和 itemWidth 至少一個需給定數(shù)據(jù).

          • 水平方向上流水布局 必須設(shè)定 itemWidth, line 和 itemHeight 至少一個需給定數(shù)據(jù).

          • 限定范圍內(nèi)固定布局 line, culomn, itemWidth, itemHeight 至少一個需給定數(shù)據(jù).

          瀑布流自動布局

          • 必須先需要設(shè)置代理 waterfallDelegate.

            - (void) hu_layoutWaterfall:(UIView *)targetView layoutCount:(NSInteger)count layoutType:(HUAutoLayoutWaterfallType)type handleBlock:(HUAutoLayoutHandleBlock)handleBlock;
          • 垂直方向上流水布局 culomn 和 itemWidth 至少設(shè)置一個. 需實現(xiàn)代理方法:

            - (CGFloat)layoutForItemHeight:(CGFloat)itemWith index:(NSUInteger)index;
          • 水平方向上流水布局 line 和 itemHeight 至少一個需給定數(shù)據(jù). 需實現(xiàn)代理方法:

            - (CGFloat)layoutForItemWidth:(CGFloat)itemHeight index:(NSUInteger)index;

          demo演示

          本demo請用: 模擬器6和6s運(yùn)行,其它屏幕未作適配.

            //注釋: demo中九宮格布局使用的是plist文件中的假數(shù)據(jù),設(shè)置 布局?jǐn)?shù)量 無用.

           

          交流郵箱

          [email protected], 歡迎交流.

          瀏覽 25
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <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>
                  麻豆中文字幕 | 午夜黄色成人网免费看 | 天天日天天看 | 美女特黄视频 | 伊人性爱网 |