+1  A: 

It seems like either you made these buttons programmatically, or you reiszed the initial IB view window to be larger and expected it to shrink down to the fit the screen.

The buttons in question cannot fit on the screen as they are - what effect are you looking for?

If you want the buttons all to fit you could set the text size to be smaller, and then they could fit.

If you want the buttons the size they are then you'll have to make another row, or put the buttons into a side scrolling container.

Kendall Helmstetter Gelner
A: 

Kendall, thanks for your answer.

Here is my solution:

    if(previousFrame.origin.x + theStringSize.width > 220){
   roundedButton.frame = CGRectMake(15, previousFrame.origin.y + 30 ,  theStringSize.width + 8, theStringSize.height);
   [myContainer insertSubview:roundedButton belowSubview:[tagsContainer.subviews lastObject]];
  }else {
   roundedButton.frame = CGRectMake(previousFrame.origin.x + previousFrame.size.width + 5, previousFrame.origin.y,  theStringSize.width + 5, theStringSize.height);
   [myContainer insertSubview:roundedButton belowSubview:[tagsContainer.subviews lastObject]]; 
  }

I calculate, how many pixel I've moved from the left side. At some threshold (in my case 220) I start a new line.

Stefan
+1  A: 

I have been using java and only recently began learning Apple's Obj-C framework.

An alternative to scrolling and row-breaking is using a "grid" layout with 1 row and n columns, where n is the number of buttons. Each cell has a fixed size. And you will have to resize your buttons (the subviews) in your superview's setNeedsLayout: method to whatever width you need such that all buttons fit the row.

See java's GridLayout class.

obsoleteModel81