如何实现以下效果?如何在图像中实现背景图像在UILabel中?
我希望当我的UIImage
宽度小于UILabel
宽度时,我的图像应该只显示一次,如下所示。
我已经用UILabel
和UIImage
做了一些更多的工作。参考我以前的问题:How to stretch Image to fill the Label Width set in Background in UILabel?。
但现在我希望有更多的乐趣与UILabel
...:d
编辑:
SBLabel *lbl = [[SBLabel alloc] initWithFrame:CGRectMake(0, 50, 320, 28)];
lbl.text = @"Hello World!!!...";
UIImage *img = [UIImage imageNamed:@"cn3.png"];
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 50, 320, 28)];
imgView.image = img;
[lbl setNonRepeatingBackgroundImage:imgView];
[self.view addSubview:lbl];
[imgView release];
我想图像不是作为不同的控制,但作为标签的背景... – DShah 2011-12-27 17:14:00