के साथ UITableView पर कक्षों के बीच अंतर मेरे पास एक XIB फ़ाइल से एक कस्टम UITableViewCell लोड करने वाला UITableView है। सब ठीक काम कर रहा है, लेकिन मेरे लेआउट की आवश्यकता है कि कोशिकाओं (सभी एक ही खंड के अंदर) उनके बीच अंतर हो। कोई भी मौका यह पंक्ति ऊंचाई बढ़ाने के बिना किया जा सकता है?कस्टम UITableViewCell
कैसे यह अब
है कि यह कैसे
संपादित होने के लिए supossed है:
यह कैसे कोड है आज
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [[self.cards valueForKeyPath:@"cards"] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
[ccTableView setBackgroundColor:[UIColor clearColor]];
cardsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cardsCell"];
if(cell == nil){
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"cardsCell" owner:self options:nil];
cell = [topLevelObjects objectAtIndex:0];
}
NSString *nmCard = [[self.cards valueForKeyPath:@"cards.name"] objectAtIndex:indexPath.row];
cell.descCardLabel.text = nmCard;
return cell;
}
आप पंक्ति ऊंचाई क्यों नहीं बढ़ा सकते हैं? सबसे आसान मामले में –
@obuseme एक xib और तीन पंक्ति राज्य (मध्य, शीर्ष, नीचे) है, कोड काफी उलझन में होगा। –
@obuseme इसके अलावा, मेरे सेल में 35 ऊंचाई वाली पृष्ठभूमि छवि है जहां लेबल है। यदि मैं पंक्ति ऊंचाई बढ़ाता हूं, तो लेआउट यह होगा कि मैं कैसे चाहता हूं, लेकिन टैपिंग चयन छवि के नीचे, दूरी पर काम करेगा, और मैं गलत पंक्ति के आकस्मिक चयन नहीं चाहता हूं। – gmogames