FirstApp,iphone开发学习总结1,UIview添加UIimage

作为第一个Tab,需要设置Title,在init内搞定:

- ( id)init {
    self = [super init];
     if (self) {
        [self setTitle: @" 图片展示 "];
        UIImage *img = [UIImage imageNamed: @""];
        [[self tabBarItem] setImage:img];
    }
     return self;

此处未添加图片名称,所以TabBar只显示“图片展示”。

在- (void)viewDidLoad 中添加view add image 代码:

UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake( 50.050.048.048.0)];
imageview.image = [UIImage imageNamed: @" China.gif "];
[self.view addSubview:imageview];
[imageview release];

 使用UIImageView添加图片,然后再add至self.view。

转载于:https://www.cnblogs.com/maxfong/archive/2012/05/03/2480143.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值