2012-11-15 1 views

답변

0

motion-tab을 사용하여 탭 표시 줄을 만들 수 있습니다.

def application(application, didFinishLaunchingWithOptions:launchOptions) 
    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) 

    tabs = [ 
    { 
     systemIcon: UITabBarSystemItemContacts, 
     navigationController: true, 
     viewController: ContactsViewController 
    }, { 
     title: "Custom", 
     icon: "custom.png", 
     navigationController: false, 
     viewController: CustomViewController.alloc.initWithCustomInit(true) 
    }, { 
     title: "Settings", 
     icon: "settings.png", 
     navigationController: true, 
     viewController: SettingsViewController 
    } 
    ] 

    tabBarController = MotionTab::TabBar.createTabBarControllerFromData(tabs) 
    MotionTab::TabBar.select(tabBarController, title: "Settings") 
    # MotionTab::TabBar.select(tabBarController, tag: 0) # Selects first tab 

    @window.rootViewController = tabBarController 
    @window.makeKeyAndVisible 
end 

주옥 (추가 정보)에서

기본 사용법

지금 현재 탭 기능을 가지고 있지 않지만,을 반환 MotionTab::TabBar에 클래스 속성을 추가 너무 어렵지 않을 것이다 현재 탭.