zoukankan      html  css  js  c++  java
  • swift3 控件创建

    //MARK:- UIScrollView

     let scrollView = UIScrollView()

            scrollView.delegate = target

            scrollView.backgroundColor = UIColor.groupTableViewBackground

            scrollView.showsHorizontalScrollIndicator = false

            scrollView.showsVerticalScrollIndicator = false

            scrollView.isPagingEnabled = true

            scrollView.bounces = false

            //使它能够在设备旋转之后自动适应新的宽度和高度

            scrollView.autoresizingMask = [UIViewAutoresizing.flexibleWidth,UIViewAutoresizing.flexibleHeight]

            scrollView.minimumZoomScale = 0.1

            scrollView.maximumZoomScale = 4.0

            scrollView.zoomScale = 1.0

    //        scrollView.minimumZoomScale = max(1, 3)

    //MARK:- UICollectionView

    var layout = layout

              let  layout = UICollectionViewFlowLayout()

                //            layout?.minimumLineSpacing = 1

                //            layout?.minimumInteritemSpacing = 10

                //            layout?.sectionInset = UIEdgeInsetsMake(10, 5, 10, 5);

              layout?.scrollDirection = direction

            let collection = UICollectionView(frame: CGRect.zero, collectionViewLayout: layout!)

            collection.backgroundColor = UIColor.groupTableViewBackground

            collection.delegate = target

            collection.dataSource = target

    //MARK:- UITableView

    let table = UITableView.init(frame: CGRect.zero, style: style)

            table.backgroundColor = UIColor.groupTableViewBackground

            table.tableFooterView = UIView()

            table.delegate = target

            table.dataSource = target

            //table.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)//分割线位置

            //table?.separatorStyle = .none //设置cell 下边线类型

            table.estimatedRowHeight = 45

            table.rowHeight = UITableViewAutomaticDimension

    群号:186052819
  • 相关阅读:
    GridView的TemplateField
    数据源绑定
    hihocoder-1415 后缀数组三·重复旋律3 两个字符串的最长公共子串
    hihocoder-1407 后缀数组二·重复旋律2 不重合 最少重复K次
    hdu number number number 斐波那契数列 思维
    最长上升子序列 nlogn
    hdu-4507 吉哥系列故事——恨7不成妻 数位DP 状态转移分析/极限取模
    hdu-3652 B-number 数位DP
    hdu-2089 不要62 基础DP 模板
    字符串hash
  • 原文地址:https://www.cnblogs.com/zuidap/p/6022682.html
Copyright © 2011-2022 走看看