#pragma mark-(AppDelegate.H文件)-----------------------------------------------------------------------#pragma mark-(.M文件)-----------------------------------------------------------------------#import "AppDelegate.h"
#import "NavigationViewController.h"
#import "NewsListTVController.h"@interface AppDelegate ()@end@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];// Override point for customization after application launch.self.window.backgroundColor = [UIColor whiteColor];[self.window makeKeyAndVisible];NewsListTVController * newListVC = [[NewsListTVController alloc]init];NavigationViewController * navlVC = [[NavigationViewController alloc]initWithRootViewController:newListVC];self.window.rootViewController = navlVC;[newListVC release];[navlVC release];return YES;
}

View Code  AppDelegate文件

#pragma mark (NavigationViewController .h文件)--------------------------------------------------------------------------------------------------------#import <UIKit/UIKit.h>@interface NavigationViewController : UINavigationController@end#pragma mark (.m文件)--------------------------------------------------------------------------------------------------------#import "NavigationViewController.h"
#import "MacroHeader.h"
#import "NewsListTVController.h"@interface NavigationViewController ()@end@implementation NavigationViewController- (void)viewDidLoad {[super viewDidLoad];[self  commonsetting];//设置共有的导航栏属性
}-(void)commonsetting{self.navigationBar.barTintColor = kmarginNavColor;self.navigationBar.tintColor = [UIColor whiteColor];
}//内存安全处理
- (void)didReceiveMemoryWarning {[super didReceiveMemoryWarning];if ([self isViewLoaded] && !self.view.window) {self.view = nil;}
}

View Code  NavigationViewController文件

#ifndef wangyiNews_09_17_MacroHeader_h
#define wangyiNews_09_17_MacroHeader_h//共有导航栏颜色
#define kmarginNavColor [UIColor colorWithRed:171/255.0 green:41/255.0 blue:15/255.0 alpha:1.0]
#define kFont_date      [UIFont systemFontOfSize:10]#define UIColorFromHexWithAlpha(hexValue,a) [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16))/255.0 green:((float)((hexValue & 0xFF00) >> 8))/255.0 blue:((float)(hexValue & 0xFF))/255.0 alpha:a]
#define UIColorFromHex(hexValue) UIColorFromHexWithAlpha(hexValue,1.0)#endif

View Code  MacroHeader.h   宏定义文件

#pragma mark (NewsListTVController .h文件)--------------------------------------------------------------------------------------------------------#import <UIKit/UIKit.h>
@class Model;
@class Model_Detail;@interface NewsListTVController : UITableViewController
@property(nonatomic,retain)Model * mod;
@property(nonatomic,retain)NSMutableArray * arry;
@end#pragma mark (.m文件)--------------------------------------------------------------------------------------------------------//
//  NewsListTVController.m
//  wangyiNews_09_17
//
//  Created by lanounjw on 15/9/17.
//  Copyright (c) 2015年 lanouhn. All rights reserved.
//

#import "NewsListTVController.h"
#import "Model.h"
#import "Type01TVCell.h"
#import "Type02TVCell.h"
#import "Type03TVCell.h"
#import "DetailViewController.h"
#import "Model_Detail.h"@interface NewsListTVController ()
@property(nonatomic,retain)NSMutableArray * dataSource;//存放数据源
@end@implementation NewsListTVController- (void)loadView {[super loadView];
}- (void)viewDidLoad {[super viewDidLoad];[self customisedNavBar];[self readFromPlist];[self.tableView registerClass:[Type01TVCell class] forCellReuseIdentifier:@"type01"];[self.tableView registerClass:[Type02TVCell class] forCellReuseIdentifier:@"type02"];[self.tableView registerClass:[Type03TVCell class] forCellReuseIdentifier:@"type03"];
}//布局私有的导航栏
-(void)customisedNavBar{self.navigationItem.title = @"网易新闻";UIBarButtonItem * left = [[UIBarButtonItem alloc]initWithTitle:@"注册" style:UIBarButtonItemStylePlain target:self action:@selector(handleRegister:)];left.tintColor = [UIColor whiteColor];self.navigationItem.leftBarButtonItem = left;UIBarButtonItem * right = [[UIBarButtonItem alloc]initWithTitle:@"登陆" style:UIBarButtonItemStylePlain target:self action:@selector(handleLogin:)];right.tintColor = [UIColor whiteColor];self.navigationItem.rightBarButtonItem = right;
}//首页注册按钮点击事件
-(void)handleRegister:(UIBarButtonItem *)sender{NSLog(@"点击注册按钮");
}//首页登陆按钮点击事件
-(void)handleLogin:(UIBarButtonItem *)sender{NSLog(@"点击登陆按钮");
}//读取本地数据源
-(void)readFromPlist{self.dataSource = [NSMutableArray arrayWithCapacity:0];NSString * filePath = [[NSBundle mainBundle] pathForResource:@"NewsData" ofType:@"plist"];NSDictionary * data = [NSDictionary  dictionaryWithContentsOfFile:filePath];for (NSString  * key in data) {if ([key isEqualToString:@"news"]) {NSArray *newsArr = [NSArray arrayWithArray:[data objectForKey:key]];for (NSDictionary * dic in newsArr) {Model * model = [[Model alloc]initWithDic:dic];[_dataSource addObject:model];[model release];}}}
}//内存警告处理
- (void)didReceiveMemoryWarning {[super didReceiveMemoryWarning];if ([self isViewLoaded] && !self.view.window) {self.view = nil;}
}#pragma mark - Table view data source- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {return 1;
}- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {return self.dataSource.count;
}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {Model * model = self.dataSource[indexPath.row];int num = indexPath.row % 3;if (num == 0) {Type01TVCell *cell = [tableView dequeueReusableCellWithIdentifier:@"type01" forIndexPath:indexPath];cell.model = model;return cell;}if (num == 1) {Type02TVCell *cell = [tableView dequeueReusableCellWithIdentifier:@"type02" forIndexPath:indexPath];cell.model = model;return cell;}if (num == 2) {Type03TVCell *cell = [tableView dequeueReusableCellWithIdentifier:@"type03" forIndexPath:indexPath];cell.model = model;return cell;}return nil;
}-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{int num = indexPath.row % 3;if (num == 2) {return 250;}return 130;
}//选中某一行新闻进入新闻详情
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{self.mod = self.dataSource[indexPath.row];Model_Detail * moArr = [[Model_Detail alloc]init];moArr.title = _mod.title;moArr.summary = _mod.summary;moArr.date = _mod.PUBLISHDATE;moArr.imageView = _mod.imageview;DetailViewController * detailVC  = [[DetailViewController alloc]init];self.arry = [NSMutableArray arrayWithArray: [moArr getArray]];//成功得到数据
    [self.navigationController pushViewController:detailVC animated:YES];[detailVC release];
}-(void)viewWillDisappear:(BOOL)animated{DetailViewController * detailVC  = [[DetailViewController alloc]init];detailVC.arr = self.arry;NSLog(@"%@",_arry);NSLog(@"页面将要消失%@",detailVC.arr);
}/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {// Return NO if you do not want the specified item to be editable.return YES;
}
*//*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {if (editingStyle == UITableViewCellEditingStyleDelete) {// Delete the row from the data source[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];} else if (editingStyle == UITableViewCellEditingStyleInsert) {// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view}
}
*//*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*//*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {// Return NO if you do not want the item to be re-orderable.return YES;
}
*//*
#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end

View Code  NewsListTVController 文件

#pragma mark (Type01TVCell .h文件)--------------------------------------------------------------------------------------------------------#import <UIKit/UIKit.h>
@class Model;@interface Type01TVCell : UITableViewCell
@property(nonatomic,retain)Model * model;
@property(nonatomic,retain)UILabel  * titleLabel;
@property(nonatomic,retain)UILabel  * summaryLabel;
@property(nonatomic,retain)UILabel  * dateLabel;
@property(nonatomic,retain)UIImageView * viewImage;@end#pragma mark (.m文件)--------------------------------------------------------------------------------------------------------//
//  Type01TVCell.m
//  wangyiNews_09_17
//
//  Created by lanounjw on 15/9/17.
//  Copyright (c) 2015年 lanouhn. All rights reserved.
//

#import "Type01TVCell.h"
#import "Model.h"
#import "MacroHeader.h"@implementation Type01TVCell-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];if (self) {[self.contentView addSubview:self.titleLabel];[self.contentView addSubview:self.summaryLabel];[self.contentView addSubview:self.dateLabel];self.viewImage =[[UIImageView alloc]initWithFrame:CGRectMake(25, 30, 50, 50)];_viewImage.tag = 101;//新闻图片是随机出现的[_viewImage setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"new%d",(arc4random()%7)+1] ofType:@"png"]]];
//        NSLog(@"%d",(arc4random()%7)+1);
        [self.contentView addSubview:_viewImage];}return self;
}-(UILabel *)titleLabel{if (!_titleLabel) {self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 5, 310, 15)];_titleLabel.backgroundColor = UIColorFromHex(0xEEEEE0);}return [[_titleLabel retain]autorelease];
}
-(UILabel *)summaryLabel{if (!_summaryLabel) {self.summaryLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, 30, 275, 80)];self.summaryLabel.adjustsFontSizeToFitWidth = YES;self.summaryLabel.numberOfLines = 0;self.summaryLabel.font = [UIFont systemFontOfSize:15];}return [[_summaryLabel retain]autorelease];
}
-(UILabel *)dateLabel{if (!_dateLabel) {self.dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(250, 110, 50, 10)];_dateLabel.font = [UIFont systemFontOfSize:10];}return [[_dateLabel retain]autorelease];
}-(void)setModel:(Model *)model{if (self.model != model) {[_model release];_model = [_model retain];}self.titleLabel.text = model.title;self.summaryLabel.text = [[model.summary substringToIndex:100]stringByAppendingString:@"..."];self.dateLabel.text = model.PUBLISHDATE;model.imageview = self.imageView;self.viewImage = model.imageview;
}
@end

View Code  Type01TVCell 文件

#pragma mark (Type02TVCell .h文件)--------------------------------------------------------------------------------------------------------#import <UIKit/UIKit.h>
@class Model;@interface Type02TVCell : UITableViewCell
@property(nonatomic,retain)Model * model;
@property(nonatomic,retain)UILabel  * titleLabel;
@property(nonatomic,retain)UILabel  * summaryLabel;
@property(nonatomic,retain)UILabel  * dateLabel;
@property(nonatomic,retain)UIImageView * viewImage;
@end#pragma mark (.m文件)--------------------------------------------------------------------------------------------------------//
//  Type02TVCell.m
//  wangyiNews_09_17
//
//  Created by lanounjw on 15/9/17.
//  Copyright (c) 2015年 lanouhn. All rights reserved.
//

#import "Type02TVCell.h"
#import "Model.h"
#import "MacroHeader.h"@implementation Type02TVCell-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];if (self) {[self.contentView addSubview:self.titleLabel];[self.contentView addSubview:self.summaryLabel];[self.contentView addSubview:self.dateLabel];self.viewImage =[[UIImageView alloc]initWithFrame:CGRectMake(290, 30, 50, 50)];//新闻图片是随机出现的[_viewImage setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"new%d",(arc4random()%7)+1] ofType:@"png"]]];[self.contentView addSubview:_viewImage];}return self;
}-(UILabel *)titleLabel{if (!_titleLabel) {self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, 5, 310, 15)];_titleLabel.backgroundColor = UIColorFromHex(0xEEEEE0);}return [[_titleLabel retain]autorelease];
}
-(UILabel *)summaryLabel{if (!_summaryLabel) {self.summaryLabel = [[UILabel alloc]initWithFrame:CGRectMake(25, 30, 260, 80)];self.summaryLabel.adjustsFontSizeToFitWidth = YES;self.summaryLabel.numberOfLines = 0;self.summaryLabel.font = [UIFont systemFontOfSize:15];}return [[_summaryLabel retain]autorelease];
}
-(UILabel *)dateLabel{if (!_dateLabel) {self.dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(250, 110, 50, 10)];_dateLabel.font = kFont_date;}return [[_dateLabel retain]autorelease];
}-(void)setModel:(Model *)model{if (self.model != model) {[_model release];_model = [_model retain];}self.titleLabel.text = model.title;self.summaryLabel.text = [[model.summary substringToIndex:100]stringByAppendingString:@"..."];self.dateLabel.text = model.PUBLISHDATE;model.imageview = self.imageView;self.viewImage = model.imageview;
}
@end

View Code  Type02TVCell 文件

#pragma mark (Type03TVCell .h文件)--------------------------------------------------------------------------------------------------------#import <UIKit/UIKit.h>
@class Model;@interface Type03TVCell : UITableViewCell
@property(nonatomic,retain)Model * model;
@property(nonatomic,retain)UILabel  * titleLabel;
@property(nonatomic,retain)UILabel  * summaryLabel;
@property(nonatomic,retain)UILabel  * dateLabel;
@property(nonatomic,retain)UIImageView * viewImage;
@end#pragma mark (.m文件)--------------------------------------------------------------------------------------------------------//
//  Type03TVCell.m
//  wangyiNews_09_17
//
//  Created by lanounjw on 15/9/17.
//  Copyright (c) 2015年 lanouhn. All rights reserved.
//

#import "Type03TVCell.h"
#import "Model.h"
#import "MacroHeader.h"@implementation Type03TVCell-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];if (self) {[self.contentView addSubview:self.titleLabel];[self.contentView addSubview:self.summaryLabel];self.summaryLabel.adjustsFontSizeToFitWidth = YES;self.summaryLabel.numberOfLines = 0;self.summaryLabel.font = [UIFont systemFontOfSize:15];[self.contentView addSubview:self.dateLabel];self.viewImage =[[UIImageView alloc]initWithFrame:CGRectMake(20, 10, 325, 100)];//新闻图片是随机出现的[_viewImage setImage:[[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"girl%d",(arc4random()%4)+1] ofType:@"png"]] imageWithRenderingMode:UIImageRenderingModeAutomatic]];[self.contentView addSubview:_viewImage];}return self;
}
//#EAEAEA
-(UILabel *)titleLabel{if (!_titleLabel) {self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(25, 120, 315, 20)];_titleLabel.backgroundColor = UIColorFromHex(0xEEEEE0);}return [[_titleLabel retain]autorelease];
}
-(UILabel *)summaryLabel{if (!_summaryLabel) {self.summaryLabel = [[UILabel alloc]initWithFrame:CGRectMake(30, 150, 300, 80)];}return [[_summaryLabel retain]autorelease];
}
-(UILabel *)dateLabel{if (!_dateLabel) {self.dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(250, 236, 50, 10)];_dateLabel.font = kFont_date;}return [[_dateLabel retain]autorelease];
}-(void)setModel:(Model *)model{if (self.model != model) {[_model release];_model = [_model retain];}self.titleLabel.text = model.title;self.summaryLabel.text = [[model.summary substringToIndex:90]stringByAppendingString:@"..."];self.dateLabel.text = model.PUBLISHDATE;model.imageview = self.imageView;self.viewImage = model.imageview;
}
@end

View Code  Type03TVCell 文件

#pragma mark (.h文件)--------------------------------------------------------------------------------------------------------#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>//封装类 把本地 plist 文件里小字典里的信息存放到一个一个的对象里
@interface Model : NSObject
@property(nonatomic,retain)NSString * title;
@property(nonatomic,retain)NSString * summary;
@property(nonatomic,retain)NSString * PUBLISHDATE;
@property(nonatomic,retain)UIImageView * imageview;
-(instancetype)initWithDic:(NSDictionary * )dic;
@end#pragma mark (.m文件)--------------------------------------------------------------------------------------------------------//
//  Model.m
//  wangyiNews_09_17
//
//  Created by lanounjw on 15/9/17.
//  Copyright (c) 2015年 lanouhn. All rights reserved.
//

#import "Model.h"@implementation Model//封装类 把找到的 key (这里的属性)赋值给封装类的属性(本类的属性)
-(instancetype)initWithDic:(NSDictionary * )dic{self = [super init];if (self) {[self setValuesForKeysWithDictionary:dic];}return  self;
}-(void)setValue:(id)value forUndefinedKey:(NSString *)key{}-(void)dealloc{self.title = nil;self.summary = nil;self.PUBLISHDATE = nil;[super dealloc];
}
@end

View Code  Model 文件

#pragma mark (.h文件)--------------------------------------------------------------------------------------------------------#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>typedef NSMutableArray * (^titleAndSummaryAndDate)(NSMutableArray * modelArr);
@interface Model_Detail : NSObject
@property(nonatomic,copy)titleAndSummaryAndDate modelArrary;
@property(nonatomic,retain)NSString * title, * summary, * date;
@property(nonatomic,retain)UIImageView * imageView;
@property(nonatomic,retain)NSMutableArray * allArrary;
-(NSMutableArray *)getArray;@end#pragma mark (.m文件)--------------------------------------------------------------------------------------------------------//  Model_Detail.m
//  wangyiNews_09_17
//
//  Created by lanounjw on 15/9/17.
//  Copyright (c) 2015年 lanouhn. All rights reserved.
//

#import "Model_Detail.h"@implementation Model_Detail-(void)setTitle:(NSString *)title{if (_title != title) {[_title release];_title = [title retain];}
}
-(void)setSummary:(NSString *)summary{if (_summary != summary) {[_summary release];_summary = [summary retain];}
}
-(void)setDate:(NSString *)date{if (_date != date) {[_date release];_date = [date retain];}
}
-(void)setImageView:(UIImageView *)imageView{if (_imageView != imageView) {[_imageView release];_imageView = [imageView retain];}
}
-(void)setModelArrary:(titleAndSummaryAndDate)modelArrary{if (_modelArrary != modelArrary) {[_modelArrary  release];_modelArrary  = [modelArrary retain];}
}
-(NSMutableArray *)getArray{NSMutableArray * arr0 = [NSMutableArray arrayWithCapacity:0];[arr0 addObject:self.title];NSMutableArray * arr1 = [NSMutableArray arrayWithCapacity:0];[arr1 addObject:self.summary];NSMutableArray * arr2 = [NSMutableArray arrayWithCapacity:0];[arr2 addObject:self.date];NSMutableArray * arr3 = [NSMutableArray arrayWithCapacity:0];[arr3 addObject:self.imageView];self.allArrary = [NSMutableArray arrayWithCapacity:0];[_allArrary addObject:arr0];[_allArrary addObject:arr1];[_allArrary addObject:arr2];[_allArrary addObject:arr3];NSLog(@"model_Detal 测试 %@",_allArrary);return _allArrary;
}@end

View Code  Model_Detail文件

#pragma mark (DetailViewController .h文件)--------------------------------------------------------------------------------------------------------#import <UIKit/UIKit.h>
#import "Model.h"@interface DetailViewController : UIViewController@property(nonatomic,retain)UILabel * titleLabel;
@property(nonatomic,retain)UILabel * summaryLabel;
@property(nonatomic,retain)UILabel * dateLabel;
@property(nonatomic,retain)UIImageView * imageView;
@property(nonatomic,retain)NSMutableArray * arr;
@property(nonatomic,retain)NSString * str0,*str1,*str2,*str3;
@end#pragma mark (.m文件)--------------------------------------------------------------------------------------------------------//
//  DetailViewController.m
//  wangyiNews_09_17
//
//  Created by lanounjw on 15/9/17.
//  Copyright (c) 2015年 lanouhn. All rights reserved.
//

#import "DetailViewController.h"
#import "NewsListTVController.h"@interface DetailViewController ()@end@implementation DetailViewController-(void)viewWillAppear:(BOOL)animated{
//    self.str0 = _arr[0];
//    self.str1 = _arr[1];
//    self.str2 = _arr[2];
//    self.str3 = _arr[3];NSLog(@"页面将要出现%@ ",_arr);
}
- (void)viewDidLoad {[super viewDidLoad];self.view.backgroundColor = [UIColor whiteColor];[self customsizedNavBar];[self makeDetialView];
}//私有导航条的设置
-(void)customsizedNavBar{self.navigationItem.title = @"新闻详情";UIBarButtonItem * left = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"btn_navigationBar_back@2x"] style:UIBarButtonItemStylePlain target:self action:@selector(handleBack:)];self.navigationItem.leftBarButtonItem = left;[left release];UIBarButtonItem * right = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"doneR@2x"] style:UIBarButtonItemStylePlain target:self action:@selector(handleAddDone:)];self.navigationItem.rightBarButtonItem = right;[right release];
}//加载详情信息页面
-(void)makeDetialView{//接受信息
//    self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 74,self.view.frame.size.width - 20, self.view.frame.size.height * 0.2)];
//    _imageView = _arr[3];
//    [self.view addSubview:self.imageView];
//    _imageView.backgroundColor = [UIColor redColor];
//    [_imageView release];
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, self.view.frame.size.height * 0.2 + 84, self.view.frame.size.width - 40,30)];_titleLabel.text = self.str0;_titleLabel.backgroundColor = [UIColor grayColor];[self.view addSubview:_titleLabel];[_titleLabel release];//自适应高度CGFloat height = 300;self.summaryLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, self.view.frame.size.height * 0.65  - 170, self.view.frame.size.width - 30, height)];[self.view addSubview:_summaryLabel];_summaryLabel.text = _arr[1];_summaryLabel.backgroundColor = [UIColor greenColor];[_summaryLabel release];self.dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.view.frame.size.width - 150,self.view.frame.size.height - 30 , 90, 20)];_dateLabel.text = _arr[2];[self.view addSubview:_dateLabel];_dateLabel.backgroundColor = [UIColor blueColor];
}//返回按钮点击事件
-(void)handleBack:(UIBarButtonItem *)sender{[self.navigationController popViewControllerAnimated:YES];
}
//收藏按钮点击事件
-(void)handleAddDone:(UIBarButtonItem *)sender{NSLog(@"触发收藏按钮点击事件");
}//内存警告处理
- (void)didReceiveMemoryWarning {[super didReceiveMemoryWarning];if ([self isViewLoaded] && !self.view.window) {self.view = nil;}
}@end

View Code  DetailViewController 文件

转载于:https://www.cnblogs.com/benpaobadaniu/p/4815341.html

UI: 网易新闻实现相关推荐

  1. 仿网易新闻客户端UI界面小Demo

    图一 图二 图三 仿网易新闻客户端UI界面Demo 图一:新闻模块 UI界面:点击下方按钮,显示相应内容的页面信息 图三:点击新闻模块上方按钮显示体育,娱乐,科技等页面,相应的内容. 所涉及的知识点: ...

  2. iOS开发 剖析网易新闻标签栏视图切换(addChildViewController属性介绍)

    iOS开发 剖析网易新闻标签栏视图切换(addChildViewController属性介绍) 本来仅仅是打算介绍一下addChildViewController这种方法的,正好今天朋友去换工作面试问 ...

  3. 新版网易新闻客户端应用源码

    2019独角兽企业重金招聘Python工程师标准>>> 源码下载: http://code.662p.com/view/11510.html 演示图:    1.这次更新的亮点是添加 ...

  4. iOS开发之AVPlayer的精彩使用---网易新闻视频播放界面的另类实现

    遇到个需求需要涉及到视频播放,那么没办法,先找资料开始进一步了解下这个不熟悉的东西 . 一个是 MP ,一个 是AV,MP是封装好的,用起来非常简单,但是自定义样式就基本不可能了.AVPlayer存在 ...

  5. [转]网易新闻客户端为什么开始在北京市区的地铁、公交站牌大批量投放广告?...

    一.可能是网易新闻客户端取得了不可思议的成功,潜力巨大,引起了网易的重视. 二.可能是京城学生上班族群体的智能手机普及率高,拓展市场. -------------------------------- ...

  6. 过去一年,网易新闻是如何甩开对手的?

    近日网易发布了在中国互联网行业堪称惊艳的2015年Q4及全年财报:2015年全年,净收入为228.03亿元人民币(35.20亿美元),同比增长94.7%:净利润67.35亿元人民币(10.40亿美元) ...

  7. RecyclerView---高仿网易新闻客户端

    本文将使用RecyclerView,带领大家实现类似网易新闻客户端的Tab界面效果. 先贴上效果图: 关于RecyclerView的基本使用大家可以参考鸿洋的文章:http://blog.csdn.n ...

  8. [Android] 仿网易新闻客户端分类排序

    转载地址:http://www.jianshu.com/p/7be162740a95 效果图 先来看看网易新闻客户端以及自己实现的效果图,效果当然还是网易的好 wangyixinwen.gif gri ...

  9. Android实战:网易新闻(附完整代码)

    一.源码地址:https://github.com/ambition-hb/News_1 二.部分内容效果图如下: (1)广告页面 (2)新闻界面 (3)热点新闻 (4)热点新闻详情界面 (5)新闻页 ...

最新文章

  1. CF332C Students' Revenge
  2. 【机器学习】扎实入门机器学习的路子
  3. python matplotlib画折线图出现连线混乱_python使用matplotlib模块绘制多条折线图、散点图...
  4. mysql系列之6--------使用第三方工具-percona来备份mysql和恢复
  5. Flutter进阶—质感设计之表单输入
  6. 微软集成 Edge 开发者工具到 Visual Studio ,工具迎来“大换血”?
  7. 本博客体系系列篇(一)
  8. mysql行转列sql函数_(转)行变列SQL语句(MSSQL) - jack - 博客园
  9. 张一鸣辞职,没那么简单
  10. 未能找到类型名称MembershipProvider
  11. 让你博客的代码显示得更酷
  12. 魔兽争霸无法在这个计算机,W7系统魔兽争霸3不能初始化DirectX怎么办
  13. Python 从入门到入魔
  14. 【科研工具】在科研人的浏览器里,多个插件多条路。
  15. Python学习记录 helloPython
  16. moveit双臂机器人程序
  17. python 加载DLL动态链接库
  18. 软件测试面试题 | 提BUG相关
  19. 2022国赛正式题nfs 解题
  20. labVIEW写入电子表格文件

热门文章

  1. web渗透-Web服务通信原理
  2. PDF转JPG免费软件有什么?这三个软件值得收藏
  3. kafka-topics.sh脚本详解
  4. java给朋友发微信_微信api接口,给微信好友收发消息
  5. 能耗指标与数据中心规模-孙长青
  6. Centos7.3安装TP-LINK驱动 TL-WDN5200H
  7. 模型推荐丨新闻传播大数据项目案例模型分享
  8. 零基础开发WIFI设备(esp8266)
  9. 【5G核心网】free5GC UPF源码分析
  10. IDEA软件常见的使用方法