2016-04-07 20 views
-1

enter image description here簡単な方法は、

は、私は、セクションのフッターにカスタムアクションにボタンを追加したいのですが、これを行うとき、私は痛みを感じました。フッターの高さを0に設定する必要があるので、別の新しいセクションを追加してカスタマイズしてください。イメージのように、カスタムフッターをセクションフッターに追加する方が良い方法はありますか?

+3

'のtableView(viewForFooterInSection:)'はあなたのフッター 'UIView'を返します。これはすでにチェックしましたか? – Eendje

答えて

0
  1. フッタービューとボタンを作成します。
  2. ボタンをフッターに追加します。
  3. さらにtableFooterプロパティに追加します。

let footerView = UIView(frame: CGRectMake(0, 0, tableView.frame.size.width, 20)) let aboutButton = UIButton(frame: CGRectMake(0, 0, 20, 20)) aboutButton.setTitle("About purchased items...", forState: UIControlState.Normal) //Here you should set the proper autolayout constraint footerView.addSubview(aboutButton) tableView.tableFooterView = footerView

関連する問題