0
我有兩個表視圖,其中包含以下聲明。UITableView中的自定義accessoryView問題
cAboutUs = [[UITableView alloc] initWithFrame:CGRectMake(85, 272, 227, 30)];
ctableView = [[UITableView alloc] initWithFrame:CGRectMake(85, 302, 227, 100)];
當我嘗試使用下面的代碼添加自定義附件視圖時,兩者都出現在單元格中的不同位置。 (在cAboutUs更向左(X)相比,ctableView細胞附件時)
UIImage *image = [UIImage imageNamed:@"bullet.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
CGRect frame = CGRectMake(0.0, 0.0, image.size.width, image.size.height);
button.frame = frame;
[button setBackgroundImage:image forState:UIControlStateNormal];
cell.accessoryView = button;
我試圖同一通過使用
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator
它正確地示出了具有良好對準。
請幫我解決這個錯誤。
對於這兩種表格視圖使用相同的圖像,它如何產生問題。 – Hanuman 2011-05-11 09:19:03
你是否同時顯示兩個表格視圖? – Jhaliya 2011-05-11 09:27:10