亚洲精品久久久久久久久久久,亚洲国产精品一区二区制服,亚洲精品午夜精品,国产成人精品综合在线观看,最近2019中文字幕一页二页

您好,歡迎來電子發(fā)燒友網(wǎng)! ,新用戶?[免費(fèi)注冊]

您的位置:電子發(fā)燒友網(wǎng)>源碼下載>通訊/手機(jī)編程>

UITableView開發(fā)需要注意的細(xì)節(jié)

大?。?/span>0.3 MB 人氣: 2017-09-26 需要積分:2

  # 1.隱藏分割線

  # 2.隱藏多余Cell

  //##?在ViewController初始化時(shí)候加載 如viewDidLoad

  //隱藏分割線

  tableView.separatorStyle = UITableViewCellSeparatorStyle.None

  //隱藏多余的cell

  tableView.tableFooterView = UIView(frame: CGRectZero)

  # 3.分割線頭部頂?shù)降?、分割線顏色

  ///##?分割線頭部頂?shù)降?、分割線顏色

  //啟動、旋轉(zhuǎn)、視圖大小位置發(fā)生改變、增加子視圖等。。都會調(diào)用

  override func viewDidLayoutSubviews() {

  tableView.separatorInset = UIEdgeInsetsZero

  tableView.layoutMargins = UIEdgeInsetsZero

  //articleTableView.separatorColor = UIColor.redColor() //分割線顏色

  }

  //沒當(dāng)cell即將出現(xiàn)屏幕時(shí)候都會調(diào)用此方法

  func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {

  cell.separatorInset = UIEdgeInsetsZero

  cell.layoutMargins = UIEdgeInsetsZero

  }

  # 4.自定義點(diǎn)擊后效果 Cell 背景等更改

  //##?在cellForRowAtIndexPath方法使用

  //點(diǎn)擊Cell時(shí),沒有點(diǎn)擊效果

  cell.selectionStyle = UITableViewCellSelectionStyle.None

  //系統(tǒng)默認(rèn)的顏色 .Blue藍(lán)色-默認(rèn) .Grap灰色 .None 無色

  //點(diǎn)擊Cell時(shí),自定義選中后的背景視圖

  //背景顏色

  cell.selectedBackgroundView = UIView()

  cell.selectedBackgroundView?.backgroundColor = UIColor.clearColor()

非常好我支持^.^

(0) 0%

不好我反對

(0) 0%

      發(fā)表評論

      用戶評論
      評價(jià):好評中評差評

      發(fā)表評論,獲取積分! 請遵守相關(guān)規(guī)定!

      ?