Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems with size of UIActionsheet in UIPopoverController
    primarykey
    data
    text
    <p>I've added an UIActionsheet with a dynamically number of buttons to a UIPopovercontroller, that appears if the popover is shown. My problem is that if the number of buttons is to hight the UIActionsheet exceeds the borders of the popover and the buttons are not shown as a list. At landscape view the actionsheet shows the buttons as a list, but the size of the actionsheet is again bigger the the popover, so that the text at the top of the popover is not visisble.</p> <p>I've added the UIActionsheet in the following way:</p> <pre><code> BookingDataDefaults *defaults = [BookingDataDefaults getInstance]; if([defaults.profils count]&gt;0){ UIActionSheet *actionSheet = [[UIActionSheet alloc]init]; actionSheet.delegate = self; actionSheet.title = NSLocalizedString(@"title", nil); int count = 0; for (ReservationProfil *profil in defaults.profils) { [actionSheet addButtonWithTitle:profil.profilName]; count++; } [actionSheet addButtonWithTitle:NSLocalizedString(@"standard", nil)]; count++; [actionSheet addButtonWithTitle:NSLocalizedString(@"cancel", nil)]; actionSheet.destructiveButtonIndex = count; [actionSheet showInView:self]; [actionSheet release]; } </code></pre> <p>The actionsheet works with a small number of buttons perfectly.</p> <p>Is there any way to set a maximum size of the UIActionsheet or change something at my view to get rid of that problem.</p> <p>PS: The size of the view in the popover is exactly the size of the contentSize of the popover.</p> <p>EDIT:</p> <p>I've test Nitish's solution, it's a little bit better but not perfect, because the subviews do not changed their size according to the superview. The best solution was to set the size of the actionsheet to the size of the popover. it places the actionsheet at the top of the popover but the list is eather to big or not shown. The result is shown down:</p> <p>Portrait old -> Portrait new</p> <p><img src="https://i.stack.imgur.com/jCIHi.png" alt="portrait old"><img src="https://i.stack.imgur.com/gqHsL.png" alt="portrait new"></p> <p>Landscape old -> Landscape new</p> <p><img src="https://i.stack.imgur.com/JrTqe.png" alt="Landscape old"><img src="https://i.stack.imgur.com/3sXEa.png" alt="Landscape new"></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