【发布时间】:2012-01-03 19:35:26
【问题描述】:
我无法在 TTView 上设置图像背景。 这是我在互联网上找到的代码,但它只显示一个黑色方块。
- (TTView *) monthBar {
if (!_monthBar) {
_monthBar = [[[TTView alloc] init] autorelease];
_monthBar.style = TTSTYLE(calendarMonthBarStyle);
_monthBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
TTImageView *imageView = [[TTImageView alloc]initWithFrame:CGRectMake(0, 0, 480, 20)];
[imageView setDefaultImage:[UIImage imageNamed:@"picture.png"]];
[self.monthBar addSubview:imageView];
[imageView release];
[self addSubview: _monthBar];
}
return _monthBar;
}
如果有人知道如何解决它,请帮助我。 谢谢!
【问题讨论】:
-
你试过用 UIImageView 代替 TTImageView 吗?
标签: iphone objective-c ios coding-style three20