Skip to content

Attributes for BMB or Pieces on BMB (Swift)

Weiping Huang edited this page May 26, 2017 · 5 revisions

How to change the size or margins of dots on BMB?

Swift | Objective-C

Attributes for BMB

We always talk about the attributes for boom-buttons of BMB, how about BMB itself?

For BMB Itself

For shadow:
bmb.hasShadow = true
bmb.shadowColor = UIColor.darkGray
bmb.shadowPathRect = CGRect.init(x: 0, y: 0, width: 60, height: 60)
bmb.shadowOffsetX = 2
bmb.shadowOffsetY = 2
bmb.shadowRadius = 5;
For button:
bmb.normalColor = UIColor.white
bmb.highlightedColor = UIColor.lightGray
bmb.unableColor = UIColor.black

BMB can be set to unable state by bmb.isUserInteractionEnabled = false

For draggable-BMB:
bmb.draggable = true
bmb.edgeInsetsInSuperView = CGRect.init(x: 20, y: 20, width: 20, height: 20)

The effect of draggable-BMB looks like below:

For Pieces on BMB

For pieces lay on BMB:

bmb.dotRadius = 2
bmb.hamWidth = 30
bmb.hamHeight = 2
bmb.pieceCornerRadius = 1
bmb.pieceHorizontalMargin = 2
bmb.pieceVerticalMargin = 2
bmb.pieceInclinedMargin = 2

You can change the dots on BMB to small squares by setting the pieceCornerRadius property, which is useful when the boom-buttons are in square-shape:

Check the demo for more information.

For Boom-Buttons on BMB

bmb.buttonHorizontalMargin = 20
bmb.buttonVerticalMargin = 20
bmb.buttonInclinedMargin = 20

For Background Color When Booming

bmb.dimColor = UIColor.darkGray

You can also add a blur-effect to background, check wiki for details.

Home
Chapters

  1. Basic Usage
  2. Simple Circle Button
  3. Text Inside Circle Button
  4. Text Outside Circle Button
  5. Ham Button
  6. Share Style
  7. Custom Position
  8. Button Place Alignments
  9. Different Ways to Boom
  10. Ease Animations for Buttons
  11. Different Order for Buttons
  12. Other Animations Attributes for Buttons
  13. Click Event and Listener
  14. Control BMB
  15. Use BMB in Navigation Bar
  16. Use BMB in Table View
  17. Attributes for BMB or Pieces on BMB
  18. Cache Optimization & Boom Area
  19. Change Boom Buttons Dynamically
  20. Blur Background & Tip
  21. Fade Views
  22. Structure of BMB
  23. Version History
Clone this wiki locally