objective c - Add an UIButton to ViewController from custom class -


I have a menu named "Menu", making UIButton:

.h file :

  @ Interface menu: NSBKect @ property (strong) form * form; @ Property (Strong) NSString * imageButtonName; @ Property (strong) UIButton * button; - (id) initWithClef: (int) clef hauteur: (int) Large size: (int) bigur posy: (int) posx: (int) posx alpha: (float) alpha imageButtonName: (NSString *) imageButtonName button :( UIButton *) button; @end   

.m file:

  #import "menu.h" @information menu @ synthesis forme = _forme; @ Synthesis button = _button; @ Synthesis imageBootname = _imageButtonName; - (id) initWithClef: (int) clef hauteur: (int) Large size: (int) bigur posy: (int) posx: (int) posx alpha: (float) alpha imageButtonName: (NSString *) imageButtonName button :( UIButton *) Button {if ((self = [super init])) {NSLog (@ "test2"); Self.forme = [[Form ALOC] initWithClef: Cloof Hitter: Houtor Bagre: Bigger Pazzy: Pausex: Paux Alpha: Alpha]; Self.button = Button; [Button Set Frame: CGRactMake (large, houter, pausx, posse)]; [Button setbackground image: [UIImage imageNamed: imageButtonName] forState: UIControlStateNormal]; } Healthy return; }   

I want to display the buttons created in the AutoView controller view. Can somebody help me out?

and add the screen parameter to your initClef ....

  - (id) initWithClef: (int) clef hauteur: (int) Large size: (int) bigur posy: (int) posx: (int) posx alpha: (float) alpha imageButtonName: (NSString *) imageButtonName button :( UIButton *) Click on the button: (UIView *) see {if ((self = [super init])) {NSLog (@ "test2"); // self.forms = [[form light] with the claffe: clough houter: hourerur big: big pazy: pozox: pausex alpha: alpha]; Self.button = Button; [Button Set Frame: CGRactMake (large, houter, pausx, posse)]; [Button setbackground image: [UIImage imageNamed: imageButtonName] forState: UIControlStateNormal]; [See adviewview: button]; } Healthy return; }   

Call it in Call Controller

  Menu * Menu 2 [[Menu Alok] initWithClef: 1 Hour: 30 Large: 30 posy: 30 posx : 30 alpha: 1 imageButtonName: @ "arti.png" button: b onView: self.view];    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -