您的位置:首页 > 移动开发 > Objective-C

objective_c第一个程序Hello World

2013-07-24 11:42 387 查看
手写:

UIlabel *label=[UIlabel alloc] initWithFrame:CGRectMake(320/2-140/2,80,140,40)];

label.text=@"Hello world";

label.textAlignment=NSTextAlignmentCenter;

label.backgroundColor=[UIColor cyanColor];

[self.window addSubView:label];

[label release];

 

添加控件:View.XIB

NSArray *views=[[NSBoundle mainBoundle] loadNibNamed:@"View"   ower:self   options:nil];

[self.window addSubView[views  lastObject]];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: