我需要在我的视图中有一个页脚,上面写着“由:{image_logo_of_my_company} 提供支持”我该如何实现?
问问题
355 次
1 回答
4
制作一个类型的包装视图,并在该视图内的适当坐标处UIView
添加 aUILabel
和徽标。UIImageView
UIView *wrapper = [[UIView alloc] initWithFrame:footerFrame];
UILabel *label = [[UILabel alloc] initWithFrame:
CGRectMake(0, 0, footerFrame.size.width*0.6, footerFrame.size.height)];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:
CGRectMake(footerFrame.size.width*0.6, 0,
footerFrame.size.width*(1.0-0.6), footerFrame.size.height)];
[wrapper addSubView:label];
[wrapper addSubView:imageView];
label.text = @"Powered by: ";
imageView.image = [UIImage imageNamed:@"logo"]; // assumes logo.png & logo@2x.png
[viewNeedingFooter addSubView:wrapper];
假设标签需要页脚宽度的 60%,徽标需要 40%。
于 2012-09-25T16:10:25.643 回答