<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          VHBoomMenuButtoniOS 爆炸效果按鈕組件

          聯(lián)合創(chuàng)作 · 2023-09-25 21:55

          VHBoomMenuButton是一個(gè)瞬間爆炸效果的菜單按鈕組件。

          使用示例:

          下面一個(gè)非常簡單的例子,如何構(gòu)建擁有三個(gè)圓形按鈕的BMB:

          //
          //  ViewController.m
          //  VHBoomMenuButtonTest
          //
          //  Created by 黃偉平 on 16/8/7.
          //  Copyright ? 2016年 黃偉平. All rights reserved.
          //
          
          #import "ViewController.h"
          #import "VHBoomMenuButton.h"
          
          #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:1.0]
          
          @interface ViewController ()
          
          @end
          
          @implementation ViewController
          
          - (void)loadView
          {
              CGRect screenFrame         = [[UIScreen mainScreen] bounds];
              self.view                  = [[UIView alloc] initWithFrame:screenFrame];
              self.view.backgroundColor  = [UIColor whiteColor];
              self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
          
              // 1. 把BMB放在你想放的地方
              CGFloat bmbRadius          = 60;
              VHBoomMenuButton *bmb      = [[VHBoomMenuButton alloc] initWithFrame:CGRectMake(screenFrame.size.width - 20 - bmbRadius,
                                                                                              screenFrame.size.height - 20 - bmbRadius,
                                                                                              bmbRadius,
                                                                                              bmbRadius)];
          
              // 2. 選擇你想要的按鈕類型
              bmb.buttonEnum             = VHButtonSimpleCircle;
          
              // 3. 在爆炸之前,告訴BMB你想怎么放在它身上
              bmb.piecePlaceEnum         = VHPiecePlace_DOT_3_1;
          
              // 4. 在爆炸之后,告訴BMB你想怎么放在屏幕上
              bmb.buttonPlaceEnum        = VHButtonPlace_SC_3_3;
          
              // 5. 添加按鈕
              [bmb addSimpleCircleButtonBuilderBlock:^(VHSimpleCircleButtonBuilder *builder) {
                  builder.imageNormal        = @"bat";
                  builder.buttonNormalColor  = UIColorFromRGB(0xD32F2F);
                  builder.buttonPressedColor = UIColorFromRGB(0xF44336);
              }];
          
              [bmb addSimpleCircleButtonBuilderBlock:^(VHSimpleCircleButtonBuilder *builder) {
                  builder.imageNormal        = @"bear";
                  builder.buttonNormalColor  = UIColorFromRGB(0xD32F2F);
                  builder.buttonPressedColor = UIColorFromRGB(0xF44336);
              }];
          
              [bmb addSimpleCircleButtonBuilderBlock:^(VHSimpleCircleButtonBuilder *builder) {
                  builder.imageNormal        = @"bee";
                  builder.buttonNormalColor  = UIColorFromRGB(0xD32F2F);
                  builder.buttonPressedColor = UIColorFromRGB(0xF44336);
              }];
          
              [self.view addSubview:bmb];
          }
          
          @end

          你所需要做的只是選擇屬性,其他由BMB完成。

          警告! 你必須保證 piecePlaceEnum的數(shù)量, buttonPlaceEnum的數(shù)量, 你添加的builders數(shù)量一致。 可以注意到,piecePlaceEnum的名字是 VHPiecePlace_XXX_N_M, XXX 是名字, N 表示按鈕數(shù)量, M 用作表示不同種類。 類似的,buttonPlaceEnum的名字是VHButtonPlace_YYY_N_M。 你必須保證兩者的N相同,當(dāng)然M可以不通,比如例子中的:VHPiecePlace_DOT_3_1VHButtonPlace_SC_3_3。

          瀏覽 16
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  国产日产久久高清欧美 | 免费黄色一级电影 | 后入极品美女在线 | 男人的天堂a v | 日屄操|