JASidePanelsDemo(侧滑)_移动开发_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > 移动开发 > JASidePanelsDemo(侧滑)

JASidePanelsDemo(侧滑)

 2014/11/17 11:06:47  粉粉色  程序员俱乐部  我要评论(0)
  • 摘要:一个很好的侧滑的Demo效果图:首页效果图:点击左上角的图标的时候的效果图:在首页向左拖动的时候的效果图:项目部分:centerViewController.m-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheview.self.title=@"center";self.view.backgroundColor=[UIColorredColor];}rightViewController.m-
  • 标签:ide

 

一个很好的侧滑的Demo

 

效果图:

 

首页效果图:

点击左上角的图标的时候的效果图:

在首页向左拖动的时候的效果图:

 

项目部分:

centerViewController.m

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title=@"center";
    self.view.backgroundColor=[UIColor redColor];
}

 

rightViewController.m

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title=@"right";
    self.view.backgroundColor=[UIColor orangeColor];
}

 

leftViewController.m

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title=@"left";
    self.view.backgroundColor=[UIColor greenColor];
}

 

AppDelegate.h

 

#import <UIKit/UIKit.h>

@class JASidePanelController;

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@property (strong, nonatomic) JASidePanelController *viewController;

@end

 

AppDelegate.m

#import "AppDelegate.h"
#import "JASidePanelController.h"
#import "centerViewController.h"
#import "leftViewController.h"
#import "rightViewController.h"



@implementation AppDelegate
@synthesize viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    
    viewController = [[JASidePanelController alloc] init];
    viewController.shouldDelegateAutorotateToVisiblePanel = NO;
    
     viewController.leftPanel = [[leftViewController alloc] init];
    viewController.centerPanel = [[UINavigationController alloc] initWithRootViewController:[[centerViewController alloc] init]];
    viewController.rightPanel = [[rightViewController alloc] init];
    
    self.window.rootViewController = self.viewController;

    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

 

发表评论
用户名: 匿名