Ios 带有4个选项卡的UITabBarController每个选项卡都使用UIScrollview启用

Ios 带有4个选项卡的UITabBarController每个选项卡都使用UIScrollview启用,ios,objective-c,uiscrollview,uitabbarcontroller,Ios,Objective C,Uiscrollview,Uitabbarcontroller,我正在尝试使用UITabBarController做一个有4个选项卡的项目,其中每个选项卡都有滚动条,我想在其中插入不同的对象并编写代码 在一个空的应用程序中,我最初为4个选项卡创建了4个XIB,并且使用以下代码成功地创建了4个选项卡视图 //ExTabBarAppdelegate.m #import "ExTabBarAppDelegate.h" #import "PersonalViewController.h" #import "EmpViewController.h" #import

我正在尝试使用UITabBarController做一个有4个选项卡的项目,其中每个选项卡都有滚动条,我想在其中插入不同的对象并编写代码

在一个空的应用程序中,我最初为4个选项卡创建了4个XIB,并且使用以下代码成功地创建了4个选项卡视图

//ExTabBarAppdelegate.m


#import "ExTabBarAppDelegate.h"
#import "PersonalViewController.h"
#import "EmpViewController.h"
#import "FinancialViewController.h"
#import "TermsViewController.h"

@implementation ExTabBarAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.

    UITabBarController *tabBarController=[[UITabBarController alloc]init];

    PersonalViewController *perVC=[[PersonalViewController alloc]initWithNibName:@"PersonalViewController" bundle:nil];

    EmpViewController *empVC=[[EmpViewController alloc]initWithNibName:@"EmpViewController" bundle:nil];

     FinancialViewController *finVC=[[FinancialViewController alloc]initWithNibName:@"FinancialViewController" bundle:nil];

     TermsViewController *terVC=[[TermsViewController alloc]initWithNibName:@"TermsViewController" bundle:nil];

     [tabBarController setViewControllers:[NSArray arrayWithObjects:perVC, empVC, finVC, terVC, nil]];

    self.window.rootViewController=tabBarController;
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}
但是我应该如何为每个选项卡启用滚动属性?? 请帮忙!
提前感谢…

在您的XIB文件中,使用
UIScrollView
而不是
UIView
查看您的viewController

以下是关于UIScrollView的教程: