user836026
user836026

Reputation: 11340

How to add a button to static UITableView using storyboard

I tried to add UIButton in UITableView below UITableViewCells using storyboard.

However, the button width filled the whole area. I could net reduce the width of UIButton using storyboard. Do I have to add it programmatically?

I'm trying to active a result similar like the button in Viber setup, as shown below.

enter image description here

Upvotes: 0

Views: 763

Answers (1)

Guillaume Algis
Guillaume Algis

Reputation: 11006

By adding the UIButton directly at the end of your table view, you're making it the table view footer, and the table view footer is required to take the whole table view width.

Try replacing your UIButton with a UIView, and add the UIButton in this UIView:

View hierarchy

Storyboard appearance

Upvotes: 1

Related Questions