Question

As a fervent adept of IB, I created a UIToolBar (in IB of course) and added to it a few buttons.

So far so good ... but then I tried to move each of them to the right position but IB doesn't let me do it ... Each time I try to scroll them IB moves them back to the former position !

Is there a way to choose their position in IB ?

If not, could you give me a piece of code for me to choose their position programatically ? (sigh :D)

Thanks,

Gotye.

Was it helpful?

Solution

If you want buttons to be anything other than left-aligned in a UIToolbar, you need to add flexible spacers alt text to your toolbar.

OTHER TIPS

Am I correct in assuming you want your buttons to be aligned to the right side of the tool bar?

Or when you say "right position" do you mean "correct position" (as in the difference between right position and wrong position, or right position and left position?)

The wording of your question is slightly ambiguous, so if you could clear that up, it would help greatly.

If you want the buttons to keep to the right-hand side of the toolbar, then you could place a flexible space item before the first button, on the left side. This will push your buttons to the right-hand side of the bar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top