最新国产好看的视频,伊人天堂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)論

永安市| 泉州市| 连云港市| 富源县| 临泽县| 许昌市| 文水县| 西藏| 榆社县| 湘乡市| 怀远县| 图片| 扶绥县| 阿拉善左旗| 垫江县| 西盟| 江西省| 亚东县| 密云县| 滨州市| 阿瓦提县| 芜湖市| 宁城县| 专栏| 南宫市| 昂仁县| 监利县| 故城县| 焉耆| 囊谦县| 华阴市| 合江县| 新竹县| 仁怀市| 沾化县| 富蕴县| 荣昌县| 霞浦县| 兴业县| 嘉善县| 元谋县|