samedi 25 avril 2015

How can I rezise a subview inside of an UIScrollView?


My app is built like this (i cannot post images)

UIViewController  
|  
|----UIView  
     |  
     |----UIScrollView   
          |  
          |----UIView (here are added my buttons, called contentView)

I would like to add buttons dinamically, depending on WebService response. I add these buttons programatically and it goes well, but the views lack space. To acomplish that goal, I have to resize the view in order to show correectly these new icons, but I cannot get the desired effect. What should I do to do this? Please, pardon my poor English xD.

== EDIT ==

Here is the code where I am adding some UISwitch to the contentView

  1. UISwitch *switchDebito=[[UISwitch alloc] initWithFrame:CGRectMake(260, 1080+(cantidadNotificacionesEnconrtadas * 35), 50, 35)];
  2. [switchDebito setOn:notification.NotificationDebit];
  3. [self.contentView addSubview:switchCredito];

In line 1 I create the switch, increasing its height eventually (not really important) Line 2 is pointless Line 3: here we add the switch to the contentView


Aucun commentaire:

Enregistrer un commentaire