方式一:
-(CGRect)titleRectForContentRect:(CGRect)contentRect
{
return CGRectMake(0, 0, 100, 70);
}
-(CGRect)imageRectForContentRect:(CGRect)contentRect
{
return CGRectMake(100, 0, 70, 70);
}
方式二:
-(void)layoutSubviews
{
[super layoutSubviews];
//设置子控件的位置
self.titleLabel.frame = CGRectMake(0, 0, 100, 70);
self.imageView.frame = CGRectMake(100, 0, 70, 70);
}
网友评论