How to add a floating button on top of a UITableView?

I need to add a floating button on top of the UITableViewController.

The following link is used to add a FloatingButton action on top of the UIViewController

Create a floating menu in an iOS application

I already tried to add this floating button to my UITableViewController, but this is not visible.

please help me thank you for your attention

+5
source share
2 answers
  • First add a UITableView and then a button. Thus, this should be so in the XIB structure (the button after the table no earlier than otherwise it will be hidden):

XIB structure

  1. Set the button restrictions associated with the superview and are not related to the UITableView.

Button Limitations

See that button restrictions are related to the superview. This is important if you need a floating button.

If everything is done correctly, it will look like this: enter image description here

+12
source

The Floating Action button on iOS can be created in a simpler way:

  • Take the button from the object library and place it where you want to place it.
  • Give the height and width 48x48.
  • Connect your button to your class and set its raidius angle to 25

    yourButton.layer.cornerRadius = 25

There you have the Fab button.

0
source

All Articles