PPRevealSideViewController第三庫的簡單例子
專注于為中小企業(yè)提供成都做網(wǎng)站、網(wǎng)站設計、外貿(mào)營銷網(wǎng)站建設服務,電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業(yè)雙牌免費做網(wǎng)站提供優(yōu)質(zhì)的服務。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了1000+企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設實現(xiàn)規(guī)模擴充和轉(zhuǎn)變。代碼下載:
http://pan.baidu.com/share/link?shareid=3833108176&uk=3189484501
這個第三方庫是能夠?qū)崿F(xiàn)左右滑動視圖控制器效果的第三方庫,第三庫在代碼例子中就有的
首先,我們需要再創(chuàng)建一個視圖控制器,讓它直接繼承自UITableViewController
我們不需要額外添加代碼。
AppDelegate.h代碼實現(xiàn)如下:
#import <UIKit/UIKit.h> #import "PPRevealSideViewController.h" @class ViewController; @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) ViewController *viewController; @property (strong, nonatomic) PPRevealSideViewController* revealSideViewController; @property (strong, nonatomic) UINavigationController* nav; @end
.m文件實現(xiàn)如下:
我們要在
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法添加如下代碼:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease]; //創(chuàng)建一個導航 self.nav = [[UINavigationController alloc] initWithRootViewController:self.viewController]; //初始化一個可以左右劃第三庫的對象 self.revealSideViewController = [[PPRevealSideViewController alloc] initWithRootViewController:self.nav]; self.revealSideViewController.panInteractionsWhenClosed = PPRevealSideInteractionContentView|PPRevealSideInteractionNavigationBar; self.window.rootViewController = self.revealSideViewController; // PP_RELEASE(self.viewController); // PP_RELEASE(self.nav); [self.window makeKeyAndVisible]; return YES; }
ViewController.h代碼實現(xiàn)如下:
#import <UIKit/UIKit.h> #import "TableViewControllerABC.h" #import "PPRevealSideViewController.h" @interface ViewController : UIViewController @property (strong , nonatomic) TableViewControllerABC* tB; @end
ViewController.m代碼如下:
-(void)viewWillAppear:(BOOL)animated { self.tB = [[TableViewControllerABC alloc] initWithStyle:UITableViewStylePlain]; //設置左劃顯示的視圖控制器 [self.revealSideViewController preloadViewController:self.tB forSide:PPRevealSideDirectionLeft]; [super viewWillAppear:animated]; }
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
文章名稱:PPRevealSideViewController第三庫的簡單例子-創(chuàng)新互聯(lián)
網(wǎng)頁鏈接:http://muchs.cn/article24/spije.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供云服務器、網(wǎng)站導航、網(wǎng)站排名、響應式網(wǎng)站、關鍵詞優(yōu)化、網(wǎng)頁設計公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)