欢迎来到天天文库
浏览记录
ID:27311400
大小:1009.50 KB
页数:8页
时间:2018-12-02
《【无限互联】ios开发 阅读器app 的开发》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、这个阅读器是仿照网易云阅读做的,读者通过此应用可以阅读最新的新闻,或者自己订阅喜爱网站的RSS,获取最新的资讯,还可以在网上书城找到自己喜爱的书籍和漫画进行在线阅读,也可以下载到本地,以便平时的离线阅读。 主要功能:书籍的本地浏览。 订阅RSS源,获取最新资讯。 阅读新闻。 查看热门书籍。 功能介绍:整体框架 这四个界面都采用MVC的架构模式,用到了网络请求的AFNetWorking框架,并且自己进行了封装,方便自己使用。解析XML的Kis
2、sXML框架,还用到下拉刷新框架EGORefreshTableHeaderView,工具类自己扩展了UIView,NSString,使其方便布局和方便使用网络请求数据中时间的显示。 自定义标签控制器,将按钮后的视图进行封装,其继承于UIView,[objc] viewplaincopy1.- (id)initWithFrame:(CGRect)frame 2. imageName:(NSString *)name 3. title:(NSString *
3、)title 4. isSelect:(BOOL)isSelect 5.{ 6. self = [super initWithFrame:frame]; 7. if (self) { 8. 9. UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake((frame.size.width-20)/2, 5, 20, 20)]; 10.
4、 11. imgView.contentMode = UIViewContentModeScaleAspectFit; 12. imgView.image = [UIImage imageNamed:name]; 13. [self addSubview:imgView]; 14. 15. //2.创建标题视图 16. 17. CGFloat maxY = CGRectGetMaxY(
5、imgView.frame); 18. UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, maxY, frame.size.width, 20)]; 19. titleLabel.text = title; 20. titleLabel.backgroundColor = [UIColor clearColor]; 21. titleLabel.textA
6、lignment = NSTextAlignmentCenter; 22. 23. if (isSelect) { 24. titleLabel.textColor = [UIColor redColor]; 25. 26. } 27. else 28. { 29. titleLabel.textColor = [UIColor grayColor
7、]; 30. } 31. titleLabel.font = [UIFont systemFontOfSize:11.0]; 32. [self addSubview:titleLabel]; 33. 34. } 35. return self; 1.} 创建标签栏:[objc] viewplaincopy1.- (void)_createTabbarView 2.{ 3. for (UIView *vie
8、w in self.tabBar.subviews) 4. { 5. Class cls = NSClassFromString(@"UITabBarButton"); 6. if ([view isKindOfClass:cls]) 7. { 8. [view removeFromSuperview]; 9. } 10. } 11. 12
此文档下载收益归作者所有