I am trying to do this, but the button does not show:
UIButton *helpButton = [UIButton buttonWithType:UIButtonTypeInfoDark ] ;
CGRect buttonRect = helpButton.frame;
buttonRect.origin.x = self.tableView.frame.size.width - buttonRect.size.width - 8;
buttonRect.origin.y = self.tableView.frame.size.height - buttonRect.size.height - 8;
[helpButton setFrame:buttonRect];
[helpButton addTarget:self action:@selector(doHelp:)
forControlEvents:UIControlEventTouchUpInside];
[helpButton setEnabled:TRUE];
[self.tableView addSubview:helpButton];
what am I doing wrong?
The UPDATE
patch code is here for anyone interested:
UIButton *helpButton = [UIButton buttonWithType:UIButtonTypeInfoDark ] ;
CGRect buttonRect = helpButton.frame;
buttonRect.origin.x = self.view.frame.size.width - buttonRect.size.width - 8;
buttonRect.origin.y = buttonRect.size.height - 8;
[helpButton setFrame:buttonRect];
[helpButton addTarget:self action:@selector(doHelp:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:helpButton];
source
share