Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding CustomView on a NavigationBar
    primarykey
    data
    text
    <p>This is my code.</p> <pre><code>- (void)viewWillAppear:(BOOL)animated { customView = [[UIView alloc] init]; UIButton *btnAdd = [[UIButton alloc] initWithFrame:CGRectMake(410, -20, 30, 40)]; [btnAdd setBackgroundColor:[UIColor blackColor]]; [btnAdd setBackgroundImage:[UIImage imageNamed:@"oie_815362uTrAOBMX.png"] forState:UIControlStateNormal]; [btnAdd addTarget:nil action:@selector(addCustomer:) forControlEvents:UIControlEventTouchUpInside]; [customView addSubview:btnAdd]; UIButton *btnJump = [[UIButton alloc] initWithFrame:CGRectMake(450, -20, 30, 40)]; [btnJump setBackgroundColor:[UIColor blueColor]]; [btnJump setBackgroundImage:[UIImage imageNamed:@"oie_8153842yVgkR6XD.jpg"] forState:UIControlStateNormal]; [btnJump addTarget:nil action:@selector(showMenue:) forControlEvents:UIControlEventTouchUpInside]; [customView addSubview:btnJump]; UIButton *btnBarItem = [[UIButton alloc] initWithFrame:CGRectMake(300, -20, 100, 40)]; [btnBarItem setBackgroundColor:[UIColor greenColor]]; [btnBarItem setBackgroundImage:[UIImage imageNamed:@"oie_99342oliBc5Sy.jpg"] forState:UIControlStateNormal]; [btnBarItem addTarget:nil action:@selector(showScanner:) forControlEvents:UIControlEventTouchUpInside]; [customView addSubview:btnBarItem]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, -10, 30, 30)]; [imageView setImage:[UIImage imageNamed:@"oie_972931iW4SHiZU.jpg"]]; [customView addSubview:imageView]; UILabel *mainLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, -20, 80, 40)]; [mainLabel setText:@"Kunden"]; [mainLabel setBackgroundColor:[UIColor lightGrayColor]]; [mainLabel setTextColor:[UIColor blackColor]]; [mainLabel setFont:[UIFont fontWithName:@"Arial" size:18]]; [customView addSubview:mainLabel]; [self.navigationItem setTitleView:customView]; } - (IBAction)showMenue:(id)sender { NewPopUpmenu *options = [[NewPopUpmenu alloc] initWithNibName:@"PopupMenu" bundle:nil]; [options.view setFrame:CGRectMake(720, 0, 300, 200)]; [self.view addSubview:options.view]; } </code></pre> <p>Note: Problem is that when i press on my "jump" button it doesn't access it's selector Method (showMenue:).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload