ho creato una barra degli strumenti di programmazione:Come aggiungere un pulsante sul lato destro della barra degli strumenti?
UIToolbar *boolbar = [UIToolbar new];
boolbar.barStyle = UIBarStyleDefault;
boolbar.tintColor = [UIColor orangeColor];
[boolbar sizeToFit];
E poi ha aggiunto un pulsante per esso:
UIBarButtonItem *cancelleftBarButton =[[UIBarButtonItem alloc]initWithTitle:@"OK" style:UIBarButtonItemStyleBordered target:self action:@selector(tapBackGround:)];
cancelleftBarButton.tintColor = [UIColor orangeColor];
NSArray *array = [NSArray arrayWithObjects:cancelleftBarButton, nil];
[boolbar setItems:array animated:YES];
Tuttavia, questo pulsante viene visualizzato solo sul lato sinistro della barra degli strumenti. È possibile metterlo sul lato destro della barra degli strumenti?
Verificate anche questi collegamenti http://stackoverflow.com/questions/602717/aligning-uitoolbar-items e http://stackoverflow.com/ domande/6021138/how-to-registrare-UIToolbar-sinistra-e-destra-padding – IronManGill