ios/oc快递查询代码 ios2048oc源代码
#import
@interface AppDelegate : UIResponder
@property (strong, nonatomic) UIWindow *window;
@end
AppDelegate.m
#import "AppDelegate.h"
#import "FirstViewController.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)applicationdidFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window= [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]];
// Overridepoint for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.windowmakeKeyAndVisible];
FirstViewController *firstView = [[FirstViewControlleralloc]init];
firstView.title = @"快递查询";
UINavigationController *navController = [[UINavigationControlleralloc]initWithRootViewController:firstView];
self.window.rootViewController = navController;
returnYES;
}
- (void)applicationWillResignActive:(UIApplication*)application
{
// Sent whenthe application is about to move from active to inactive state.This can occur for certain types of temporary interruptions (suchas an incoming phone call or SMS message) or when the user quitsthe application and it begins the transition to the backgroundstate.
// Use thismethod to pause ongoing tasks, disable timers, and throttle downOpenGL ES frame rates. Games should use this method to pause thegame.
}
- (void)applicationDidEnterBackground:(UIApplication*)application
{
// Use thismethod to release shared resources, save user data, invalidatetimers, and store enough application state information to restoreyour application to its current state in case it is terminatedlater.
// If yourapplication supports background execution, this method is calledinstead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication*)application
{
// Called aspart of the transition from the background to the inactive state;here you can undo many of the changes made on entering thebackground.
}
- (void)applicationDidBecomeActive:(UIApplication*)application
{
// Restartany tasks that were paused (or not yet started) while theapplication was inactive. If the application was previously in thebackground, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Calledwhen the application is about to terminate. Save data ifappropriate. See also applicationDidEnterBackground:.
}
@end
FirstViewController.h
#import
@interface FirstViewController : UIViewController
{
UIButton*yunda;
UIButton*ems;
UIButton*yuantong;
UIButton*shentong;
UIButton*more;
UIButton*shunfeng;
UIButton*tiantian;
}
- (void)select;
@end
FirstViewController.m
#import "FirstViewController.h"
#import "SecondViewControlloer.h"
#import "OtherViewController.h"
@implementation FirstViewController
- (void)loadView{
[superloadView];
UIColor*testColor= [UIColor colorWithRed:150/255.0 green:200/255.0blue:255/255.0 alpha:1];
self.view.backgroundColor = testColor;
[selfselect];
}
- (void)select{
//韵达
yunda =[[UIButton alloc]initWithFrame:CGRectMake(10, 100, 140, 50)];
[yundasetBackgroundImage:[UIImage imageNamed:@"yunda"]forState:UIControlStateNormal];
[yundasetTag:1];
[yundaaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:yunda];
//EMS
ems =[[UIButton alloc]initWithFrame:CGRectMake(170, 100, 140,50)];
[emssetBackgroundImage:[UIImage imageNamed:@"EMS"]forState:UIControlStateNormal];
[emssetTag:2];
[emsaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:ems];
//圆通
yuantong =[[UIButton alloc]initWithFrame:CGRectMake(10, 195, 140, 50)];
[yuantongsetBackgroundImage:[UIImage imageNamed:@"yuantong"]forState:UIControlStateNormal];
[yuantongsetTag:3];
[yuantongaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:yuantong];
//申通
shentong =[[UIButton alloc]initWithFrame:CGRectMake(170, 195, 140,50)];
[shentongsetBackgroundImage:[UIImage imageNamed:@"shentong"]forState:UIControlStateNormal];
[shentongsetTag:4];
[shentongaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:shentong];
//顺丰
shunfeng =[[UIButton alloc]initWithFrame:CGRectMake(10, 280, 140, 50)];
[shunfengsetBackgroundImage:[UIImage imageNamed:@"shunfeng"]forState:UIControlStateNormal];
[shunfengsetTag:5];
[shunfengaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:shunfeng];
//天天
tiantian =[[UIButton alloc]initWithFrame:CGRectMake(170, 280, 140,50)];
[tiantiansetBackgroundImage:[UIImage imageNamed:@"tiantian"]forState:UIControlStateNormal];
[tiantiansetTag:6];
[tiantianaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:tiantian];
//其他
more =[[UIButton alloc]initWithFrame:CGRectMake(10, 380, 300, 60)];
[moresetBackgroundColor:[UIColor greenColor]];
[moresetTitle:@"更多快递..." forState:UIControlStateNormal];
[moresetTag:7];
[moreaddTarget:self action:@selector(clickTwo:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:more];
}
- (void)click:(UIButton *)buton{
SecondViewControlloer *viewScend = [[SecondViewControlloer alloc]init];
//viewScend.title.
viewScend.title = @"查询";
switch([buton tag]) {
case 1:
[viewScend companyName:@"yunda" withChinese:@"韵达快递"];
break;
case 2:
[viewScend companyName:@"ems" withChinese:@"EMS"];
break;
case 3:
[viewScend companyName:@"yuantong" withChinese:@"圆通快递"];
break;
case 4:
[viewScend companyName:@"shentong" withChinese:@"申通快递"];
break;
case 5:
[viewScend companyName:@"shunfeng" withChinese:@"顺丰快递"];
break;
case 6:
[viewScend companyName:@"tiantian" withChinese:@"天天快递"];
break;
//case 7:
//[self clickTwo];
//break;
}
[self.navigationController pushViewController:viewScendanimated:YES];
}
- (void)clickTwo:(UIButton *)button{
OtherViewController *viewOfOther = [[OtherViewControlleralloc]init];
viewOfOther.title = @"其他快递";
[self.navigationController pushViewController:viewOfOtheranimated:YES];
}
@end
OtherViewController.h
#import
@interface OtherViewController : UIViewController
@end
OtherViewController.m
#import "OtherViewController.h"
#import "SecondViewControlloer.h"
@implementation OtherViewController
- (void)viewDidLoad{
[superviewDidLoad];
UIColor*testColor= [UIColor colorWithRed:150/255.0 green:200/255.0blue:255/255.0 alpha:1];
//A开头
UILabel *A =[[UILabel alloc]initWithFrame:CGRectMake(10, 70, 10, 20)];
[AsetText:@"A"];
[AsetFont:[UIFont systemFontOfSize:10]];
[AsetBackgroundColor:[UIColor greenColor]];
[self.viewaddSubview:A];
//中通
UIButton*anxinda = [[UIButton alloc]initWithFrame:CGRectMake(25, 70, 50,20)];
[anxindasetTitle:@"安信达快递" forState:UIControlStateNormal];
anxinda.titleLabel.font = [UIFont systemFontOfSize:10];
[anxindasetBackgroundColor:testColor];
[anxindaaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[anxindasetTag:1];
[self.viewaddSubview:anxinda];
//天天
UIButton*anjie = [[UIButton alloc]initWithFrame:CGRectMake(80, 70, 50,20)];
[anjiesetTitle:@"安捷快递" forState:UIControlStateNormal];
anjie.titleLabel.font = [UIFont systemFontOfSize:10];
[anjiesetBackgroundColor:testColor];
[anjieaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[anjiesetTag:2];
[self.viewaddSubview:anjie];
//B开头
UILabel *B =[[UILabel alloc]initWithFrame:CGRectMake(10, 100, 10, 20)];
[BsetText:@"B"];
[BsetFont:[UIFont systemFontOfSize:10]];
[BsetBackgroundColor:[UIColor greenColor]];
[self.viewaddSubview:B];
//彪记
UIButton*biaoji = [[UIButton alloc]initWithFrame:CGRectMake(25, 100, 50,20)];
[biaojisetTitle:@"彪记快递" forState:UIControlStateNormal];
biaoji.titleLabel.font = [UIFont systemFontOfSize:10];
[biaojisetBackgroundColor:testColor];
[biaojiaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[biaojisetTag:3];
[self.viewaddSubview:biaoji];
//BNT
UIButton*bnt = [[UIButton alloc]initWithFrame:CGRectMake(80, 100, 50,20)];
[bntsetTitle:@"BNT" forState:UIControlStateNormal];
bnt.titleLabel.font = [UIFont systemFontOfSize:10];
[bntsetBackgroundColor:testColor];
[bntaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[bntsetTag:4];
[self.viewaddSubview:bnt];
//C开头
UILabel*C = [[UILabel alloc]initWithFrame:CGRectMake(10,130, 10, 20)];
[C setText:@"C"];
[CsetFont:[UIFont systemFontOfSize:10]];
[CsetBackgroundColor:[UIColor greenColor]];
[self.viewaddSubview:C];
//COE
UIButton*coe = [[UIButton alloc]initWithFrame:CGRectMake(25, 130, 50,20)];
[coesetTitle:@"COE" forState:UIControlStateNormal];
coe.titleLabel.font = [UIFont systemFontOfSize:10];
[coesetBackgroundColor:testColor];
[coeaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[coesetTag:5];
[self.viewaddSubview:coe];
//长宇
UIButton*changyu = [[UIButton alloc]initWithFrame:CGRectMake(80, 130, 50,20)];
[changyusetTitle:@"长宇快递" forState:UIControlStateNormal];
changyu.titleLabel.font = [UIFont systemFontOfSize:10];
[changyusetBackgroundColor:testColor];
[changyuaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[changyusetTag:6];
[self.viewaddSubview:changyu];
//Y开头
UILabel*Y = [[UILabel alloc]initWithFrame:CGRectMake(10,160, 10, 20)];
[Y setText:@"Y"];
[YsetFont:[UIFont systemFontOfSize:10]];
[YsetBackgroundColor:[UIColor greenColor]];
[self.viewaddSubview:Y];
//亚风
UIButton*yafeng = [[UIButton alloc]initWithFrame:CGRectMake(25, 160, 50,20)];
[yafengsetTitle:@"亚风快递" forState:UIControlStateNormal];
yafeng.titleLabel.font = [UIFont systemFontOfSize:10];
[yafengsetBackgroundColor:testColor];
[yafengaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[yafengsetTag:7];
[self.viewaddSubview:yafeng];
//一邦
UIButton*yibang = [[UIButton alloc]initWithFrame:CGRectMake(80, 160, 50,20)];
[yibangsetTitle:@"一邦快递" forState:UIControlStateNormal];
yibang.titleLabel.font = [UIFont systemFontOfSize:10];
[yibangsetBackgroundColor:testColor];
[yibangaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[yibangsetTag:8];
[self.viewaddSubview:yibang];
//优速
UIButton*yousu = [[UIButton alloc]initWithFrame:CGRectMake(135, 160, 50,20)];
[yoususetTitle:@"优速快递" forState:UIControlStateNormal];
yousu.titleLabel.font = [UIFont systemFontOfSize:10];
[yoususetBackgroundColor:testColor];
[yousuaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[yoususetTag:9];
[self.viewaddSubview:yousu];
//远成
UIButton*yuancheng = [[UIButton alloc]initWithFrame:CGRectMake(190, 160,50, 20)];
[yuanchengsetTitle:@"远成快递" forState:UIControlStateNormal];
yuancheng.titleLabel.font = [UIFont systemFontOfSize:10];
[yuanchengsetBackgroundColor:testColor];
[yuanchengaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[yuanchengsetTag:10];
[self.viewaddSubview:yuancheng];
//源伟丰
UIButton*yuanweifeng = [[UIButton alloc]initWithFrame:CGRectMake(245, 160,50, 20)];
[yuanweifengsetTitle:@"源伟丰快递" forState:UIControlStateNormal];
yuanweifeng.titleLabel.font = [UIFont systemFontOfSize:10];
[yuanweifengsetBackgroundColor:testColor];
[yuanweifengaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[yuanweifengsetTag:11];
[self.viewaddSubview:yuanweifeng];
//运通
UIButton*yuntong = [[UIButton alloc]initWithFrame:CGRectMake(25, 190, 50,20)];
[yuntongsetTitle:@"运通快递" forState:UIControlStateNormal];
yuntong.titleLabel.font = [UIFont systemFontOfSize:10];
[yuntongsetBackgroundColor:testColor];
[yuntongaddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[yuntongsetTag:11];
[self.viewaddSubview:yuntong];
//自己输入
UIButton*other = [[UIButton alloc]initWithFrame:CGRectMake(10, 380, 300,60)];
[othersetTitle:@"其他快递" forState:UIControlStateNormal];
[othersetBackgroundColor:testColor];
[otheraddTarget:self action:@selector(click:)forControlEvents:UIControlEventTouchUpInside];
[othersetTag:100];
[self.viewaddSubview:other];
}
- (void)click:(UIButton *)button
{
SecondViewControlloer *viewScend = [[SecondViewControlloer alloc]init];
viewScend.title = @"查询";
switch([button tag]) {
case 1:
[viewScend companyName:@"anxinda" withChinese:@"安信达快递"];
break;
case 2:
[viewScend companyName:@"anjie" withChinese:@"安捷快递"];
break;
case 3:
[viewScend companyName:@"biaoji" withChinese:@"彪记快递"];
break;
case 4:
[viewScend companyName:@"bnt" withChinese:@"BNT"];
break;
case 5:
[viewScend companyName:@"coe" withChinese:@"COE"];
break;
case 6:
[viewScend companyName:@"changyu" withChinese:@"长宇快递"];
break;
case 7:
[viewScend companyName:@"yafeng" withChinese:@"亚风快递"];
break;
case 8:
[viewScend companyName:@"yibang" withChinese:@"一邦快递"];
break;
case 9:
[viewScend companyName:@"yousu" withChinese:@"优速快递"];
break;
case 10:
[viewScend companyName:@"yuancheng" withChinese:@"远成快递"];
break;
case 11:
[viewScend companyName:@"yuntong" withChinese:@"运通快递"];
break;
case 100:
[viewScend companyName:@"" withChinese:@""];
break;
}
[self.navigationController pushViewController:viewScendanimated:YES];
}
@end
SecondViewControlloer.h
#import
@interface SecondViewControlloer : UIViewController
{
UITextField*setNumber;
UITextField*setName;
}
@property(nonatomic,retain)NSString *comName;
- (void)companyName:(NSString *)name withChinese:(NSString*)chinese;
@end
SecondViewControlloer.m
#import "SecondViewControlloer.h"
#import "ThirdViewController.h"
@implementation SecondViewControlloer
- (void)companyName:(NSString *)name withChinese:(NSString*)chinese{
NSLog(@"%@,%@",name,chinese);
self.comName= name;
[selfviewOfInput:name addChinese:chinese];
}
- (void)viewOfInput:(NSString *)comName addChinese:cName{
//label公司名
UILabel*name=[[UILabel alloc]initWithFrame:CGRectMake(20, 150, 60,50)];
[namesetTextColor:[UIColor blackColor]];
[namesetBackgroundColor:[UIColor clearColor]];
[namesetText:@"公司名"];
//label运单号
UILabel*number=[[UILabel alloc]initWithFrame:CGRectMake(20, 200, 60,50)];
[numbersetTextColor:[UIColor blackColor]];
[numbersetBackgroundColor:[UIColor clearColor]];
[numbersetText:@"运单号"];
[self.viewaddSubview:name];
[self.viewaddSubview:number];
//textField输入公司名称
setName=[[UITextField alloc]initWithFrame:CGRectMake(80, 160,200,30)];
[setNamesetBackgroundColor:[UIColor whiteColor]];
[setNamesetPlaceholder:@"输入快递名 如:yunda"];
//setName.
[setNamesetText:cName];
[setNamesetTextColor:[UIColor grayColor]];
[setNamesetBorderStyle:UITextBorderStyleRoundedRect];
[setNamesetFont:[UIFont systemFontOfSize:18]];
[setNameresignFirstResponder];
setName.delegate = self;
//textField输入运单号
setNumber=[[UITextField alloc]initWithFrame:CGRectMake(80,210, 200,30)];
[setNumbersetBackgroundColor:[UIColor whiteColor]];
[setNumbersetPlaceholder:@"输入运单号"];
[setNumbersetBorderStyle:UITextBorderStyleRoundedRect];
[setNumbersetReturnKeyType:UIReturnKeyDone];
[setNumbersetTextColor:[UIColor greenColor]];
[setNumbersetFont:[UIFont systemFontOfSize:18]];
setNumber.delegate = self;
[self.viewaddSubview:setNumber];
[self.viewaddSubview:setName];
UIColor*testColor= [UIColor colorWithRed:150/255.0 green:200/255.0blue:255/255.0 alpha:1];
//查询按钮
UIButton*buttonOne = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];
buttonOne.frame=CGRectMake(90, 260, 150, 50);
[buttonOnesetBackgroundColor:testColor];
[buttonOnesetTitle:@"查询" forState:UIControlStateNormal];
buttonOne.titleLabel.font = [UIFont systemFontOfSize:20];
[buttonOnesetTitleColor:[UIColor blackColor]forState:UIControlStateNormal];
//[buttonOnesetBackgroundImage:[UIImage imageNamed:@"search"]forState:UIControlStateNormal];
[buttonOneaddTarget:self action:@selector(clic:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:buttonOne];
}
-(void)resume{
[self.viewsetFrame:CGRectMake(0, 0, 320, 480)];
}
//按任意处键盘消失
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event{
[setNameresignFirstResponder];
[setNumberresignFirstResponder];
}
#pragma mark texfiledDelegte
- (void)textFieldDidBeginEditing:(UITextField *)textField{
if(textField == setNumber) {
[self.view setFrame:CGRectMake(0, -40, 320, 480)];
}
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
[textFieldresignFirstResponder];
[selfresume];
returnYES;
}
- (void)textFieldDidEndEditing:(UITextField *)textField{
[textFieldresignFirstResponder];
[selfresume];
}
//点击后的方法
-(void)clic:(UIButton *)button{
ThirdViewController *viewThird = [[ThirdViewController alloc]init];
//viewScend.view.backgroundColor=[UIColor greenColor];
[viewThirdflashDataWithName:self.comName withNumber:[setNumber text]];
viewThird.title = @"查询结果";
[self.navigationController pushViewController:viewThirdanimated:YES];
}
@end
ThirdViewController.h
#import
@interface ThirdViewController : UIViewController
@property(nonatomic)NSMutableData *receiveData;
@property(nonatomic)NSURLRequest *request;
@property(nonatomic)UIColor *testColor;
@property(nonatomic)UILabel *lableWrong;
- (void)flashDataWithName:(NSString *)strName withNumber:(NSString*)strNum;
- (void)showInView:(NSArray *)dic;
@end
ThirdViewController.m
#import "ThirdViewController.h"
@implementation ThirdViewController
- (void)flashDataWithName:(NSString *)strName withNumber:(NSString*)strNum{
NSString*urlName = [[NSString alloc]init];
NSString*urltext = [[NSString alloc]init];
NSString*urlNum = [[NSString alloc]init];
NSLog(@"urlNum=%@",urlNum);
if(!(strName== urltext)){
urlName = [NSString stringWithFormat:@"?company=%@",strName];
}
if(!(strNum== urltext)){
urlNum = [NSString stringWithFormat:@"&id=%@",strNum];
}
UIColor*testColor= [UIColor colorWithRed:150/255.0 green:200/255.0blue:255/255.0 alpha:1];
NSString*strUrl = [NSStringstringWithFormat:@"http://222.24.63.109/express/%@%@",urlName,urlNum];
NSLog(@"%@",strUrl);
NSURL*urlOne = [NSURL URLWithString:strUrl];
NSLog(@"%@",urlOne);
_request =[NSURLRequest requestWithURL:urlOne];
NSURLConnection *connection = [[NSURLConnectionalloc]initWithRequest:_request delegate:self];
if(!connection) {
NSLog(@"Failed to submit request");
UILabel *lable = [[UILabel alloc]initWithFrame:CGRectMake(50, 100,220, 100)];
lable.backgroundColor = testColor;
lable.text = @"未联网";
[lable setTextAlignment:NSTextAlignmentCenter];
[self.view addSubview:lable];
} else{
NSLog(@"Request submitted");
NSLog(@"%@",connection);
}
}
#pragma mark - NSURLConnectionDataDelegate
//收到服务器回应的时候调用此方法
- (void)connection:(NSURLConnection *)connectiondidReceiveResponse:(NSURLResponse *)response{
//NSLog(@"response=%@",response);
_receiveData=[NSMutableData alloc];
}
//接收到服务器传输数据的时候调用,此方法根据数据大小执行若干次
- (void)connection:(NSURLConnection *)connectiondidReceiveData:(NSData *)data{
[_receiveData appendData:data];
}
//请求完之后调用
- (void)connectionDidFinishLoading:(NSURLConnection*)connection{
UIColor*testColor= [UIColor colorWithRed:150/255.0 green:200/255.0blue:255/255.0 alpha:1];
_lableWrong= [[UILabel alloc]initWithFrame:CGRectMake(50, 150, 220,100)];
[_lableWrongsetTextAlignment:NSTextAlignmentCenter];
_lableWrong.backgroundColor = testColor;
_lableWrong.numberOfLines = 0;
NSLog(@"connectionDidFinishLoading");
NSString*infoString = [[NSString alloc]initWithData:_receiveDataencoding:NSUTF8StringEncoding];
NSLog(@"返回的json数据为:%@",infoString);
//返回信息处理
if([infoString isEqualToString:@"null"]) {
NSLog(@"查询成功但运单过期或没有物流信息");
_lableWrong.text = @"查询成功但运单过期或没有物流信息";
[self.view addSubview:_lableWrong];
}
elseif([infoString isEqualToString:@"Param_Error"]){
NSLog(@"缺少参数");
_lableWrong.text = @"缺少参数";
[self.view addSubview:_lableWrong];
}
elseif([infoString isEqualToString:@"Illegal_ID"]){
NSLog(@"运单号或快递公司编码无效");
_lableWrong.text = @"运单号或快递公司编码无效";
[self.view addSubview:_lableWrong];
}
elseif([infoString isEqualToString:@"Server_Error"]){
NSLog(@"服务其错误");
_lableWrong.text = @"运单号或快递公司编码无效";
[self.view addSubview:_lableWrong];
}
else{
NSLog(@"成功");
NSArray *array = [NSJSONSerializationJSONObjectWithData:_receiveData options:NSJSONReadingAllowFragments error:nil];
[self showInView:array];
}
}
- (void)showInView:(NSArray *)array{
inti=0;
for(NSDictionary *dic in array){
//lable显示时间
UILabel *showTime = [[UILabel alloc]initWithFrame:CGRectMake(10,65+i*30, 30, 15)];
[showTime setFont:[UIFont fontWithName:nil size:10]];
[showTime setTextColor:[UIColor redColor]];
[showTime setText:@"时间:"];
[self.view addSubview:showTime];
//lable显示状态
UILabel *showDetail = [[UILabel alloc]initWithFrame:CGRectMake(10,80+i*30, 30, 15)];
[showDetail setFont:[UIFont fontWithName:nil size:10]];
[showDetail setTextColor:[UIColor greenColor]];
[showDetail setText:@"状态:"];
[self.view addSubview:showDetail];
//label显示具体时间
showTime = [[UILabel alloc]initWithFrame:CGRectMake(40, 65+i*30,280, 15)];
[showTime setFont:[UIFont fontWithName:nil size:10]];
//[showTime setBackgroundColor:[UIColor redColor]];
[showTime setText:[dic objectForKey:@"Time"]];
[self.view addSubview:showTime];
//lable显示具体状态
showDetail = [[UILabel alloc]initWithFrame:CGRectMake(40, 80+i*30,280, 15)];
[showDetail setFont:[UIFont fontWithName:nil size:10]];
//[showDetail setBackgroundColor:[UIColor greenColor]];
[showDetail setText:[dic objectForKey:@"Detail"]];
[self.view addSubview:showDetail];
i++;
}
}
@end
更多阅读
寄东西到国外哪种快递方式最好 国外快递查询
寄东西到国外哪种快递方式最好——简介 现在出国留学的越来越多,很多时候,都会有从国内家里寄点东西到国外,那么寄东西到国外哪种快递方式最好呢?个人来说,这方面经验比较多一点,拿出来分享一下,如果有什么地方讲的不对,也请大家改正或者补
快递小帮手 - EMS快递单号查询|韵达|天天|圆通快递查询 圆通快递单号
快递网点查询 | 快递大全 | 查询软件 | 报错/建议 | ☆放入收藏夹常用快递公司全国网点资料及价格查询 | 国际快递价格起点→终点→重量→ 如您的快递单号查不了,请过2小时再查询 | 下载到桌面为方便使用,请记住〖快递小帮手〗:www
VBS代码格式化工具的源码 代码格式化 源代码
VBS代码格式化工具的源码:━━━━━━━━━━━━━━━━━━━━━━━━━OptionExplicitIfWScript.Arguments.Count=0ThenMsgBox"请将要格式化的代码文件拖动到这个文件上",vbInformation,"使用方法"WScript.QuitEndIf '作者:D
ios 视频播放代码Demo ios 播放flv视频代码
方法一:- (void)viewDidLoad{[super viewDidLoad];// Do any additional setup after loading the view.//利用自带MPMoviePlayerController来实现视频播放,首先要在 项目中导入MediaPlayer.Framework框架包.//在试图控制器中导入#i
最新实用查询代码 超实用的jquery代码段
教育课程心理测试减肥食谱高清影视物流快递电脑提速网游加速交通违章万年历酒店查询算命大全姓名测试生肖属相外汇牌价家常菜谱