-
Notifications
You must be signed in to change notification settings - Fork 112
Custom Position (Objective C)
Weiping Huang edited this page May 13, 2017
·
2 revisions
Customize the number and positions of pieces and boom-buttons.
Swift | Objective-C
Sometimes we may want 12 boom-buttons or more, and perhaps we need to put the 12 pieces and boom-buttons to the positions that are not supported in BMB. Then you can customize number and positions of pieces and boom-buttons.
bmb.buttonEnum = VHButtonTextInsideCircle;
bmb.piecePlaceEnum = VHPiecePlaceCustom;
bmb.buttonPlaceEnum = VHButtonPlaceCustom;
for (int i = 0; i < 3; i++)
{
[bmb addBuilder:[BuilderManager textInsideCircleButtonBuilder]];
}
Then you need to tell BMB the positions of pieces:
[bmb.customPiecePositions addObject:[NSValue valueWithCGPoint:CGPointMake(+6, -6)]];
[bmb.customPiecePositions addObject:[NSValue valueWithCGPoint:CGPointMake(0, 0)]];
[bmb.customPiecePositions addObject:[NSValue valueWithCGPoint:CGPointMake(-6, +6)]];
And the positions of boom-buttons:
[bmb.customButtonPositions addObject:[NSValue valueWithCGPoint:CGPointMake(-60, -60)]];
[bmb.customButtonPositions addObject:[NSValue valueWithCGPoint:CGPointMake(0, 0)]];
[bmb.customButtonPositions addObject:[NSValue valueWithCGPoint:CGPointMake(+60, +60)]];
Notice that the coordinate system is the same as iPhone but the center position is (0, 0). And you don't need to customize both pieces and boom-buttons, check demo for more details.
Home
Chapters
- Basic Usage
- Simple Circle Button
- Text Inside Circle Button
- Text Outside Circle Button
- Ham Button
- Share Style
- Custom Position
- Button Place Alignments
- Different Ways to Boom
- Ease Animations for Buttons
- Different Order for Buttons
- Other Animations Attributes for Buttons
- Click Event and Listener
- Control BMB
- Use BMB in Navigation Bar
- Use BMB in Table View
- Attributes for BMB or Pieces on BMB
- Cache Optimization & Boom Area
- Change Boom Buttons Dynamically
- Blur Background & Tip
- Fade Views
- Structure of BMB
- Version History