0
我想爲UITableViewController設置背景圖像。我已經得到了下面的代碼,它可以將背景設置得很好,但圖像本身被拉伸到通常尺寸的兩倍左右。UITableViewController背景圖像拉伸
[[self view] setAutoresizesSubviews:NO];
UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.frame];
backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Default.png"]];
self.tableView.backgroundView = backgroundView;
self.tableView.backgroundColor = [UIColor clearColor];
[backgroundView release];
圖片是隻有640x960像素。
我試過手動設置backgroundView
的框架,但它不會改變背景圖像的大小。
任何人都可以解釋我要去哪裏錯了嗎?
非常感謝。
這工作很好! UIImageView管理完美地檢測圖像尺寸。並感謝關於這兩個圖像的提示:) – 2011-04-07 22:48:08