How to add floating button on top of the UITableView?
Asked Answered
L

2

9

I need to add floating button on top of UITableViewController.

The following link is used for adding FloatingButton action on top of UIViewController

Creating a floating menu in an iOS application

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

please help me thank you inadvance

Lapp answered 6/5, 2016 at 13:41 Comment(1)
github.com/satishVekariya/SUITabViewArmandinaarmando
E
21
  1. First add the UITableView and then the Button. So it should be like this in the XIB Structure (Button is after the Table not before otherwise it will be hidden):

XIB Structure

  1. Set the Button Constraints related to the Super View and not related to UITableView.

Button Constraints

See that button constraints are related to superview. This is important if you want the Floating Button.

If everything is done correctly it would show like this: enter image description here

Enchanter answered 6/5, 2016 at 13:54 Comment(0)
A
-3

Floating Action button on IOS can be created with way more easier way:

  1. Take a button from object library and place it where ever you want it to be placed.
  2. Give its height and width 48x48.
  3. Connect your button to your class and set its corner raidius to 25

    yourButton.layer.cornerRadius = 25

There you have your Fab button.

Aver answered 4/4, 2018 at 10:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.