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
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
Overwrite viewWillLayoutSubViews method in your view controller and set the content view frames inside it
- (void)viewWillLayoutSubViews {
[super viewWillLayoutSubViews];
//set your frames here
}
对于所有希望以相同问题查找araund的人,只需将滚动条的框架设置得更大,然后再设置内容视图框架,瞧!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.