嘗試設置的backgroundColor並查看錶,沒有運氣(Xcode的5 iOS7.1的iPad模擬器),用於iPhone看起來不錯,但在iPad上淺灰色的背景色...
與合作backgroundColor爲細胞本身在iOS 7上爲我解決了這個問題。1二千〇一十四分之四
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"ViewSomeTriggerCell";
// get a cell or a recycled cell
sictVCViewSomeTriggerCell *cellTrigger = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// put a picture and a word in the cell (positions set in .xib)
NSString * tname = [self.fetchedTriggersArray objectAtIndex:indexPath.row];
cellTrigger.imageTrigger.image = [UIImage imageNamed:@"icon_appicon.png"];
cellTrigger.labelName.text = tname;
// set background color, defeats iPad wierdness
// http://stackoverflow.com/questions/2688007/uitableview-backgroundcolor-always-gray-on-ipad
// clearColor is what I wanted, and it worked, also tested with purpleColor
cellTrigger.backgroundColor =[UIColor clearColor];
return cellTrigger;
}
啊,現在iPhone和iPad再次在iOS6中對齊:-) – Gerd 2012-06-12 16:38:40
Bravo使用了很少使用的術語「重現步驟」! :- – 2012-08-16 22:15:40