美好的一天......我想知道你是否可以帮助我。仅当应用程序到达导航路径中的最后一个可能视图(我的应用程序深度为3个视图;登录,菜单和配置文件视图)时,才会应用样式表中的样式。当应用程序到达配置文件视图时,那么样式应用程序将应用到应用程序中,并且所有内容都应该按照应有的样式进行设置。我在应用程序的appdelegate applicationDidFinishLaunching方法中实例化了样式表对象。
- (void)applicationDidFinishLaunching:(UIApplication *)application {
TTNavigator *navigator = [TTNavigator navigator];
navigator.window = _window;
[TTStyleSheet setGlobalStyleSheet:[[[BNDefaultStylesheet alloc] init] autorelease]];
TTURLMap *map = navigator.URLMap;
[map from:@"tt://startView"
toSharedViewController:[StartViewController class]];
[map from:@"tt://profilePage"
toSharedViewController:[JumpsiteProfilePage class]];
[map from:@"tt://mainMenu"
toSharedViewController:[MenuViewController class]];
[navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://startView"]];
//[navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://characterList"]];
// Override point for customization after application launch
[_window makeKeyAndVisible];}
[TTStyleSheet setGlobalStyleSheet:[[[BNDefaultStylesheet alloc] init] autorelease]];
TTURLMap *map = navigator.URLMap;
[map from:@"tt://startView"
toSharedViewController:[StartViewController class]];
[map from:@"tt://profilePage"
toSharedViewController:[JumpsiteProfilePage class]];
[map from:@"tt://mainMenu"
toSharedViewController:[MenuViewController class]];
[navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://startView"]];
//[navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://characterList"]];
// Override point for customization after application launch
[_window makeKeyAndVisible];}
答案 0 :(得分:1)
如果ViewController是TTViewController ......
,Stlyesheet将立即应用如果您的视图是从nib加载的,只需在视图控制器viewDidLoad方法中添加它 [[NSBundle mainBundle] loadNibNamed:@“YourNibName”owner:self options:nil];
我认为,当你只是对UIViewController进行子类化时,Three20中会有一些更新的样式