最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

詳解ios中scrollView上使用masonry

 更新時(shí)間:2018年02月06日 11:02:20   投稿:laozhang  
本篇文章主要給大家詳細(xì)分析了ios開(kāi)發(fā)中scrollView上使用masonry的詳細(xì)知識(shí)內(nèi)容,需要的朋友參考下吧。

使用scrollView的一個(gè)子視圖對(duì)contentSize進(jìn)行調(diào)整

_scroll_Bg = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 100, SCREEN_W, 200)];
  _scroll_Bg.pagingEnabled = YES;
  _scroll_Bg.delegate = self;
  _scroll_Bg.backgroundColor = [UIColor redColor];
  [self.view addSubview:_scroll_Bg];

1,現(xiàn)在scrollView添加一個(gè)主要子視圖,大小貼合scrollView

UIView *bgView = [[UIView alloc] init];
  bgView.backgroundColor = [UIColor blueColor];
  [_scroll_Bg addSubview:bgView];
  [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.top.left.bottom.and.right.equalTo(_scroll_Bg).with.insets(UIEdgeInsetsZero);
    make.width.equalTo(_scroll_Bg);
  }];

2,此后所有子視圖都需添加在此bgView上

UIView *childV = [[UIView alloc] init];
  childV.backgroundColor = [UIColor cyanColor];
  [bgView addSubview:childV];
  [childV mas_makeConstraints:^(MASConstraintMaker *make) {
    make.left.right.mas_equalTo(0);
    make.top.mas_equalTo(250);
    make.height.mas_equalTo(1000);
  }];

3,以最后所加子視圖為準(zhǔn),再對(duì)bgView進(jìn)行重新約束

[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.bottom.equalTo(childV.mas_bottom);
  }];

以上就是本次給大家整理的全部?jī)?nèi)容,如果還有任何不明白的地方可以在下方的留言區(qū)討論,感謝你對(duì)腳本之家的支持。

相關(guān)文章

最新評(píng)論

青川县| 永川市| 沙坪坝区| 九寨沟县| 赤壁市| 城步| 恩平市| 河曲县| 饶平县| 本溪| 通州市| 福州市| 南漳县| 康马县| 历史| 北票市| 本溪市| 集安市| 婺源县| 淮南市| 太仓市| 宣威市| 澄江县| 邵东县| 余干县| 海原县| 武定县| 宜城市| 合作市| 凤凰县| 曲阜市| 沈阳市| 平罗县| 高要市| 牡丹江市| 南和县| 蒙自县| 确山县| 丰县| 延津县| 理塘县|