UI界面
查看次数:3530
下载次数:612
上传时间:2016-03-25
大小:391 B
可以切换视图,随机改变颜色。拷贝SunSegmentedControl.h和SunSegmentedControl.m 在ViewController.m文件中实现 SunSegmentedControl *av=[[SunSegmentedControl alloc]initWithFrame:CGRectMake(0, 200, self.view.frame.size.width, 44)titles:@[@"",@"",@"",@"",@"" ] backblock:^(NSInteger index){
NSLog(@"%@",av);}];
self.navigationItem.titleView=av;在AppDelegate.m 创建一个导航栏 ViewController *nc=[[ViewController alloc]init];
UINavigationController *vc=[[UINavigationController alloc]initWithRootViewController:nc];
self.window.rootViewController=vc;
就可以调用这里的方法了
收藏