#import "ViewController.h"
@interface ViewController ()
{
UIView * _view0;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// 设置屏幕背景色
self.view.backgroundColor = [UIColor whiteColor];
// 加载view
[self _loadViews];
// 加载tabbar
[self _loadTabBar];
}
- (void)_loadTabBar{
// 初始化UITabBar
UITabBar * tabBar = [[UITabBar alloc]initWithFrame:CGRectMake(0, self.view.frame.size.height - 49, self.view.frame.size.width, 49)];
tabBar.delegate = self;// 设置自己为代理
// 初始化barItem
UIImage * imgForItem1 = [UIImage imageNamed:@"icon_cinema"];
UIImage * imgForItem2 = [[UIImage imageNamed:@"icon_cinema@2x"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UITabBarItem * item1 = [[UITabBarItem alloc]initWithTitle:@"Cinema" image:imgForItem1 selectedImage:imgForItem2];
item1.tag = 100;
UITabBarItem * item2 = [[UITabBarItem alloc]initWithTitle:@"2" image:[UIImage imageNamed:@"more_select_setting"] tag:101];
UITabBarItem * item3 = [[UITabBarItem alloc]initWithTitle:@"3" image:[UIImage imageNamed:@"movie_cinema"] tag:102];
UITabBarItem * item4 = [[UITabBarItem alloc]initWithTitle:@"Movie" image:[UIImage imageNamed:@"msg_new"] tag:103];
UIImage * img1ForItem5 = [UIImage imageNamed:@"start_top250"];// 未设置保持原色
UIImage * img2ForItem5 = [[UIImage imageNamed:@"start_top250"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];//保持原色,在图片初始化时实现
UITabBarItem * item5 = [[UITabBarItem alloc]initWithTitle:@"9" image:img1ForItem5 selectedImage:img2ForItem5];
// NSBackgroundColorAttributeName
// 用字典设置item5的字体颜色
NSDictionary * dict = @{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor yellowColor]};
// 设置高亮状态的字体及颜色
[item5 setTitleTextAttributes:dict forState:UIControlStateHighlighted];
NSArray * array = @[item1,item2,item3,item4,item5];
tabBar.items = array;
tabBar.selectedItem = array[0];// 默认选中
[self.view addSubview:tabBar];
}
- (void)_loadViews{
UIView * view1 = [[UIView alloc ]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-49)];
view1.backgroundColor = [UIColor redColor];
view1.tag =200;
UIView * view2 = [[UIView alloc ]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height -49)];
view2.backgroundColor = [UIColor yellowColor];
view2.tag =201;
UIView * view3 = [[UIView alloc ]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-49)];
view3.backgroundColor = [UIColor blueColor];
view3.tag =202;
UIView * view4 = [[UIView alloc ]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-49)];
view4.backgroundColor = [UIColor greenColor];
view4.tag =203;
UIView * view5 = [[UIView alloc ]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-49)];
view5.backgroundColor = [UIColor grayColor];
view5.tag =204;
_view0 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 49)];
[self.view addSubview:_view0];
[_view0 addSubview:view5];
[_view0 addSubview:view3];
[_view0 addSubview:view4];
[_view0 addSubview:view2];
[_view0 addSubview:view1];
}
#pragma mark - UITabBarDelegate
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
NSInteger tag = item.tag;
UIView * view = [self.view viewWithTag:tag+100];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:_view0 cache:YES];
[_view0 bringSubviewToFront:view];
[UIView commitAnimations];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
设置UITabBar自己为代理实现页面的动画转场(MS)设置UITabBar自己为代理实现页面的动画转场(MS)设置UITabBar自己为代理实现页面的动画转场(MS)设置UITabBar自己为代理实现页面的动画转场(MS)设置UITabBar自己为代理实现页面的动画转场(MS)设置UITabBar自己为代理实现页面的动画转场(MS)设置UITabBar自己为代理实现页面的动画转场(MS)设置UITabBar自己为代理实现页面的动画转场(MS)设置UITabBar自己为代理实现页面的动画转场(MS)设置UITabBar自己为代理实现页面的动画转场(MS)

HTMLISNOTAPROGRAMMENGUAGE; ITISAMARKUMARKUPLAGUAGE.1)htmlStructures andFormatSwebContentusingtags.2)itworkswithcsssforstylingandjavascript for Interactivity,增强WebevebDevelopment。

HTML是构建网页结构的基石。1.HTML定义内容结构和语义,使用、、等标签。2.提供语义化标记,如、、等,提升SEO效果。3.通过标签实现用户交互,需注意表单验证。4.使用、等高级元素结合JavaScript实现动态效果。5.常见错误包括标签未闭合和属性值未加引号,需使用验证工具。6.优化策略包括减少HTTP请求、压缩HTML、使用语义化标签等。

HTML是一种用于构建网页的语言,通过标签和属性定义网页结构和内容。1)HTML通过标签组织文档结构,如、。2)浏览器解析HTML构建DOM并渲染网页。3)HTML5的新特性如、、增强了多媒体功能。4)常见错误包括标签未闭合和属性值未加引号。5)优化建议包括使用语义化标签和减少文件大小。

WebDevelovermentReliesonHtml,CSS和JavaScript:1)HTMLStructuresContent,2)CSSStyleSIT和3)JavaScriptAddSstractivity,形成thebasisofmodernWebemodernWebExexperiences。

HTML的作用是通过标签和属性定义网页的结构和内容。1.HTML通过到、等标签组织内容,使其易于阅读和理解。2.使用语义化标签如、等增强可访问性和SEO。3.优化HTML代码可以提高网页加载速度和用户体验。

htmlisaspecifictypefodyfocusedonstructuringwebcontent,而“代码” badlyLyCludEslanguagesLikeLikejavascriptandPytyPythonForFunctionality.1)htmldefineswebpagertuctureduseTags.2)“代码”代码“ code” code code code codeSpassSesseseseseseseseAwiderRangeLangeLangeforLageforLogageforLogicIctInterract

HTML、CSS和JavaScript是Web开发的三大支柱。1.HTML定义网页结构,使用标签如、等。2.CSS控制网页样式,使用选择器和属性如color、font-size等。3.JavaScript实现动态效果和交互,通过事件监听和DOM操作。

HTML定义网页结构,CSS负责样式和布局,JavaScript赋予动态交互。三者在网页开发中各司其职,共同构建丰富多彩的网站。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

Dreamweaver Mac版
视觉化网页开发工具

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

SublimeText3 Linux新版
SublimeText3 Linux最新版

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。