Stworzyłem niestandardową UITableViewCell w IB, połączyłem ją z właściwością kontrolera widoku root i ustawiłem ją w CellForRowAtIndexPath. Ale wysokość moich narysowanych komórek nie pasuje do tego, co ustawiłem w IB, porady? Oto kilka zrzutów ekranu i kod. Własna stalówka UITableViewCell wysokość
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *AddressCellIdentifier = @"AddressCellIdent";
UITableViewCell *thisCell = [tableView dequeueReusableCellWithIdentifier:AddressCellIdentifier];
if (thisCell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"AddressCell" owner:self options:nil];
thisCell = addressCell;
self.addressCell = nil;
}
return thisCell ;
}
addressCell jest @property (nonatomic przypisać) IBOutlet UITableViewCell * addressCell ;, i wiąże się w IB do właściciela pliku (widok kontrolera tabela).
Używam przykładu z przewodnika programowania widoku tabeli Apple.
Śledź ten link i uzyskać odpowiedzi na swoje pytanie - [dostać wysokości wiersza z pliku NIB] [1] [1]: http://stackoverflow.com/a/18503213/2086991 – Aznix