ScrollView上新增多個ViewController
阿新 • • 發佈:2019-02-09
-(void)setUI
{
UIStoryboard * tmpStoryboard = [UIStoryboardstoryboardWithName:@"Main"bundle:[NSBundlemainBundle]];
//基礎資訊 _basicInformationVC = [tmpStoryboard instantiateViewControllerWithIdentifier:@"BasicInformationViewController"];
[_basicInformationVCviewWillAppear:YES];
// _gongyingPhotoVC.view.backgroundColor = [UIColor purpleColor];
_basicInformationVC.view.frame
=
CGRectMake(0,
0,
SCREEN_W,
_scrollView.frame.size.height);
//產品圖片 _gongyingPhotoVC = [tmpStoryboard instantiateViewControllerWithIdentifier:@"GongYingPhotoViewController"];
[_gongyingPhotoVCviewWillAppear:YES];
// _gongyingPhotoVC.view.backgroundColor = [UIColor purpleColor];
_gongyingPhotoVC.view.frame
=
CGRectMake(SCREEN_W,
0,
SCREEN_W,
_scrollView.frame.size.height);
//主要引數 _gongyingParameterVC = [tmpStoryboard instantiateViewControllerWithIdentifier:@"GongYingParameterViewController"];
[_gongyingParameterVCviewWillAppear:YES];
// _gongyingParameterVC.view.backgroundColor = [UIColor greenColor];
_gongyingParameterVC.view.frame
=
CGRectMake(SCREEN_W*2,
0,
SCREEN_W,
_scrollView.frame.size.height);
//交易條件 _gongyingConditionVC = [tmpStoryboard instantiateViewControllerWithIdentifier:@"GongYingConditionViewController"];
[_gongyingConditionVCviewWillAppear:YES];
// _gongyingConditionVC.view.backgroundColor = [UIColor redColor]; _gongyingConditionVC.view.frame = CGRectMake(SCREEN_W*3, 0, SCREEN_W, _scrollView.frame.size.height);
[_scrollViewaddSubview:_gongyingPhotoVC.view];
[_scrollViewaddSubview:_gongyingConditionVC.view];
{
UIStoryboard * tmpStoryboard = [UIStoryboardstoryboardWithName:@"Main"bundle:[NSBundlemainBundle]];
//基礎資訊 _basicInformationVC = [tmpStoryboard instantiateViewControllerWithIdentifier:@"BasicInformationViewController"];
[_basicInformationVCviewWillAppear:YES];
// _gongyingPhotoVC.view.backgroundColor = [UIColor purpleColor];
//產品圖片 _gongyingPhotoVC = [tmpStoryboard instantiateViewControllerWithIdentifier:@"GongYingPhotoViewController"];
[_gongyingPhotoVCviewWillAppear:YES];
// _gongyingPhotoVC.view.backgroundColor = [UIColor purpleColor];
//主要引數 _gongyingParameterVC = [tmpStoryboard instantiateViewControllerWithIdentifier:@"GongYingParameterViewController"];
[_gongyingParameterVCviewWillAppear:YES];
// _gongyingParameterVC.view.backgroundColor = [UIColor greenColor];
//交易條件 _gongyingConditionVC = [tmpStoryboard instantiateViewControllerWithIdentifier:@"GongYingConditionViewController"];
[_gongyingConditionVCviewWillAppear:YES];
// _gongyingConditionVC.view.backgroundColor = [UIColor redColor]; _gongyingConditionVC.view.frame = CGRectMake(SCREEN_W*3, 0, SCREEN_W, _scrollView.frame.size.height);
[_scrollViewaddSubview:_gongyingPhotoVC.view];
[_scrollViewaddSubview:_gongyingConditionVC.view];