단일 뷰 기반을 사용하여 응용 프로그램을 만들었습니다. 이제 15 개의 메뉴와 각 메뉴에 대한 설명을 표시해야합니다. 나는 UITableView
을 사용하여 생각했습니다. 내가 프로그래밍 여기에 설명을 추가하기 위해 각각의 설명을 각 ViewController
또는 바로 가기를 만들 필요가 긴 텍스트를 & 이미지 content.Do를 표시한다 셀은 테이블 뷰 내 코드이 셀 때 UIAlertView
을 만드는 것입니다개별적으로 UITableView 및 세부 뷰를 만드는 방법
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Set up the cell...
cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:15];
cell.textLabel.text = [NSString stringWithFormat:@"Cell Row #%d", [indexPath row]];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// open a alert with an OK and cancel button
NSString *alertString = [NSString stringWithFormat:@"Clicked on row #%d", [indexPath row]];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:alertString message:@"" delegate:self cancelButtonTitle:@"Done" otherButtonTitles:nil];
[alert show];
[alert release];
}
만졌어.
어떻게하면 긴 텍스트 및 이미지 display.Any 아이디어 pls 할 수 있습니다.
그것은 당신이 그 (15) 뷰 컨트롤러뿐만 아니라 관련된 복잡성에 표시 할 내용에 따라 달라집니다. – rishi
자세히보기에서 클릭 한 색인을 얻을 수 있으며 자세히보기를 표시 할 수 있습니다! – NSException