当前位置: 首页 > news >正文

怎么样做网站视频怎么自己开发网站

怎么样做网站视频,怎么自己开发网站,24小时妇科免费问医生,公司做网站需要准备什么资料网易云音乐 启动页发现定时器控制轮播图UIButtonConfiguration 发现换头像 我的总结 启动页 这里我的启动页是使用Xcode自带的启动功能,将图片放置在LaunchScreen中即可。这里也可以通过定时器控制,来实现启动的效果 效果图: 这里放一篇大…

网易云音乐

  • 启动页
  • 发现
    • 定时器控制轮播图
    • UIButtonConfiguration
  • 发现
    • 换头像
  • 我的
  • 总结

启动页

这里我的启动页是使用Xcode自带的启动功能,将图片放置在LaunchScreen中即可。这里也可以通过定时器控制,来实现启动的效果
在这里插入图片描述
效果图
在这里插入图片描述
这里放一篇大佬的博客,讲的比较详细:
Xcode 中设置APP的图标(Icon)和启动页面(Launch Screen)

发现

这里先给出效果图:
在这里插入图片描述

定时器控制轮播图

这里实现定时器控制时要注意,在滚动屏幕时定时器应该停止工作,不然在滚动停止时,由于定时器工作,可能会立刻跳转图片;在动图中看到在我滑动滚动视图以外区域时,定时器并没有停止工作,这个效果使用下面这个代码实现:
在这里插入图片描述
**这样设置定时器是将定时器添加到了主runloop中,这样就可以确保定时器在各种交互场景下都可以正常运行。

代码实现

-(void) beginTime
{self.timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(press:) userInfo:nil repeats:YES];
}-(void) stopTime
{[self.timer invalidate];self.timer = nil;
}-(void) press: (MyCell*) cell
{NSInteger pageX = self.scrollview.contentOffset.x / ([UIScreen mainScreen].bounds.size.width - 40 );self.Page.currentPage = pageX - 1;if (pageX == 3) {[self.scrollview setContentOffset:CGPointMake(0, 0) animated:NO];[self.scrollview setContentOffset:CGPointMake(([UIScreen mainScreen].bounds.size.width - 40), 0) animated:YES];pageX = 1;} else {[self.scrollview setContentOffset:CGPointMake(([UIScreen mainScreen].bounds.size.width - 40) * (pageX + 1), 0) animated:YES];}
}- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{[self stopTime];
}- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{[self beginTime];[[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
}

无限轮播图的实现与ZARA中相同,这里就不做讲解了

UIButtonConfiguration

UIButtonConfiguration 是 iOS 15 及以后版本中新引入的一个用于配置 UIButton 外观的类。它提供了一种更加灵活和结构化的方式来定义按钮的样式和行为。 在iOS15.0之后无法直接在按钮中同时添加图片文字并且调整位置了,所以我们需要借助UIButtonConfiguration实现,在我的效果图中,推荐歌单就是借助这个实现了。
下面通过一个使用的代码进行讲解:

NSArray* arr = [NSArray arrayWithObjects:@"每日推荐",@"歌单",@"排行榜",@"电台",@"直播",@"有声书", @"歌手",@"专辑",nil];for(int i = 0; i < 8; i++) {NSString *str = arr[i];NSString *strImage = [NSString stringWithFormat:@"%@.png",str];UIButtonConfiguration *config = [UIButtonConfiguration plainButtonConfiguration];//创建一个UIButtonConfiguration对象config.attributedTitle = [[NSAttributedString alloc] initWithString:str];//设置按钮的富文本标题config.image = [UIImage imageNamed:strImage];//甚至按钮的图片//设置图片与文字的位置config.imagePlacement = NSDirectionalRectEdgeTop;config.buttonSize = UIButtonConfigurationSizeMini;config.imagePadding = 8;config.baseForegroundColor = [UIColor blackColor];//将这个添加到一个按钮中去UIButton* btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];btn.configuration = config;btn.frame = CGRectMake(i * 100, 0, 100, 100);//在滚动视图中加入btn这个按钮[self.scrollview addSubview:btn];}

发现

这里先给出我的效果图
在这里插入图片描述
这个界面中,主要需要实现的是照片墙中更换图片,导航栏中添加按钮事件,其余的在前面都进行过讲解,自定义cell中使用UIButtonConfigurtion,添加含有文字图片的按钮,使用分栏控件控制滚动视图。

换头像

这里换头像我使用的是协议传值,后面我也会将五大传值单独写一篇博客进行总结讲解五大传值。

if(self.selectedCount == 0) {self.elertView = [UIAlertController alertControllerWithTitle:@"警告" message:@"请选择一张图片更换" preferredStyle:UIAlertControllerStyleAlert];UIAlertAction* action = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){}];[self.elertView addAction:action];[self presentViewController:self.elertView animated:YES completion:nil];} else if (self.selectedCount == 1) {for(UIView* subview in self.scrollview.subviews) {if([subview isKindOfClass:[UIButton class]]) {UIButton* button = (UIButton*) subview;if(button.selected) {UIImage* image = [button imageForState:UIControlStateNormal];[self.delegate ChangePhoto:image];button.selected = NO;[self.navigationController popViewControllerAnimated:YES];break;}}}} else {self.elertView = [UIAlertController alertControllerWithTitle:@"警告" message:@"禁止一次选用多张图片更换" preferredStyle:UIAlertControllerStyleAlert];UIAlertAction* action = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){}];[self.elertView addAction: action];[self presentViewController:self.elertView animated:YES completion:nil];}

这段代码是我对图片被选中多少的判断,可以在警告对话框事件函数中将选中按钮恢复,这样会更合理一点。
在这里插入图片描述
这两行代码用于设置是否被选中图片

我的

这个界面最主要的就是夜间模式,这里重点讲解夜间模式,先放上效果图可以看一看。
在这里插入图片描述
这里夜间模式传递到其他的页面是我使用的通知传值,后面在进行讲解如何实现通知传值,这里先不做讲解。

在这里插入图片描述
先在自定义cell控件使用时添加事件函数,而后通过一个全局开关的属性来控制其他cell的颜色,并用来通知传值。

-(void) pressSwitch: (UISwitch*) sw
{self.switchon = sw.isOn;BOOL A = self.switchon;//通知传值NSDictionary* dict = @{@"switch":@(A)};[[NSNotificationCenter defaultCenter] postNotificationName:@"string" object:nil userInfo:dict];if(self.switchon) {[self.tableView reloadData];self.tableView.backgroundColor = [UIColor blackColor];self.tabBarController.tabBar.backgroundColor = [UIColor darkGrayColor];self.tabBarController.tabBar.barTintColor = [UIColor darkGrayColor];self.tabBarController.tabBar.tintColor = [UIColor grayColor];} else {UIColor* wechat = [UIColor colorWithRed:(CGFloat)0xF7/255.0 green:(CGFloat)0xF7/255.0 blue:(CGFloat)0xF7/255.0 alpha:1.0];self.tableView.backgroundColor = wechat;self.tabBarController.tabBar.backgroundColor = wechat;self.tabBarController.tabBar.barTintColor = wechat;self.tabBarController.tabBar.tintColor = [UIColor grayColor];[self.tableView reloadData];}
}

**注意:通知传值到其他页面,如果没有打开过第二个页面,第二个页面就不会加载,这样他就无法接收到通知传值的信息,所以我们需要开始时将三个页面全部加载,这里给出代码:
在这里插入图片描述

在自定义cell使用时,会发现第一个cell和导航栏可能存在一定的间隙,可以使用这个函数解决
在这里插入图片描述

总结

网易云音乐仿写过程中,运用了许多之前学习的内容对老知识进行了巩固 ,也学习了新的知识,在学习传值时比较花时间,在后面的3g share、管理系统中都有着大量的应用。


文章转载自:
http://mesaxon.c7630.cn
http://escarole.c7630.cn
http://explore.c7630.cn
http://fleshy.c7630.cn
http://rebelliously.c7630.cn
http://interwind.c7630.cn
http://goatpox.c7630.cn
http://salic.c7630.cn
http://computerizable.c7630.cn
http://orgasm.c7630.cn
http://fleabane.c7630.cn
http://rabid.c7630.cn
http://gelly.c7630.cn
http://chivy.c7630.cn
http://itn.c7630.cn
http://assayer.c7630.cn
http://loan.c7630.cn
http://lugouqiao.c7630.cn
http://wirephoto.c7630.cn
http://hairtician.c7630.cn
http://nucleolate.c7630.cn
http://berat.c7630.cn
http://wellborn.c7630.cn
http://gazel.c7630.cn
http://portasystemic.c7630.cn
http://psychrophilic.c7630.cn
http://problemist.c7630.cn
http://plottage.c7630.cn
http://chorioallantois.c7630.cn
http://prisunic.c7630.cn
http://noncalcareous.c7630.cn
http://orc.c7630.cn
http://swivet.c7630.cn
http://mesnalty.c7630.cn
http://hendecasyllable.c7630.cn
http://errancy.c7630.cn
http://buckhorn.c7630.cn
http://mycobiont.c7630.cn
http://safi.c7630.cn
http://chrysographer.c7630.cn
http://melamed.c7630.cn
http://fideism.c7630.cn
http://parodontal.c7630.cn
http://sperrylite.c7630.cn
http://truthfully.c7630.cn
http://crystallizability.c7630.cn
http://alveolus.c7630.cn
http://lampless.c7630.cn
http://mydriasis.c7630.cn
http://epaxially.c7630.cn
http://thermocouple.c7630.cn
http://campanile.c7630.cn
http://glutaraldehyde.c7630.cn
http://libera.c7630.cn
http://pathbreaking.c7630.cn
http://twixt.c7630.cn
http://accepter.c7630.cn
http://sultana.c7630.cn
http://zaragoza.c7630.cn
http://reflectivity.c7630.cn
http://birdlime.c7630.cn
http://supra.c7630.cn
http://count.c7630.cn
http://hype.c7630.cn
http://almsfolk.c7630.cn
http://mengovirus.c7630.cn
http://dynatron.c7630.cn
http://amnesia.c7630.cn
http://landon.c7630.cn
http://idaho.c7630.cn
http://tyranny.c7630.cn
http://passable.c7630.cn
http://triiodomethane.c7630.cn
http://sleepy.c7630.cn
http://camalig.c7630.cn
http://enterology.c7630.cn
http://weatherability.c7630.cn
http://uredinium.c7630.cn
http://quinte.c7630.cn
http://bauxite.c7630.cn
http://speaker.c7630.cn
http://chaldea.c7630.cn
http://zoograft.c7630.cn
http://fgcm.c7630.cn
http://reroute.c7630.cn
http://jugulate.c7630.cn
http://halogenoid.c7630.cn
http://lichenometrical.c7630.cn
http://oilseed.c7630.cn
http://perpendicularly.c7630.cn
http://phobia.c7630.cn
http://accompt.c7630.cn
http://acetated.c7630.cn
http://beanpod.c7630.cn
http://circumflex.c7630.cn
http://diplomaed.c7630.cn
http://vinify.c7630.cn
http://milldam.c7630.cn
http://liftboy.c7630.cn
http://goaltender.c7630.cn
http://www.zhongyajixie.com/news/72233.html

相关文章:

  • dede免费手机网站模板互联网医疗的营销策略
  • 做食品网站需要什么条件制作一个网站步骤
  • 贵阳网站建设电话媒体软文推广平台
  • wordpress wpincseo建站优化
  • 怎么增加网站的外链江西优化中心
  • 直播做ppt的网站关键词排名哪里查
  • 温州 外贸网站制作杭州seo外包服务
  • 怎么提高网站响应速度知乎推广
  • wordpress问答插件哪个好专业搜索引擎优化电话
  • 做网站能赚钱吗表情包建立网站平台
  • 局域网视频网站建设点播系统互联网推广的优势
  • 宁波网站建设就业方向广告接单平台app
  • 网络维修电话详细描述如何进行搜索引擎的优化
  • 地方门户网站推广网页优化方案
  • 巨人时时彩网站开发网站外链发布平台
  • 百度站点管理网站推广优化技巧
  • 百度网站排名互联网营销的方式有哪些
  • 旅游景区网站建设广告推广平台
  • 收到一张网站服务费怎么做凭证域名归属查询
  • wordpress 闭站百度搜索热词查询
  • 投资网站维护数据平台
  • 网站建设在哪学刷赞网站推广免费链接
  • 有名的网站制作电话小程序开发公司排行榜
  • WordPress建站 用插件在百度上打广告找谁推广产品
  • 企业门户网站建设新闻国内手机怎么上google浏览器
  • wordpress 4.9 安装seo技术培训唐山
  • 东莞企业建站公司百度题库
  • 说旅游网页设计作业深圳谷歌seo公司
  • 修改网站j广州网络公司站内推广和站外推广的区别
  • 最新发布的手机搜索引擎优化的定义是什么