Skip to content

Instantly share code, notes, and snippets.

@kastner
Created August 7, 2008 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kastner/4334 to your computer and use it in GitHub Desktop.
Save kastner/4334 to your computer and use it in GitHub Desktop.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
return @"Type your Question:";
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 180.0f;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
}
// Configure the cell
CGRect rect;
rect.origin.x = 10;
rect.origin.y = 10;
rect.size.width = 295;
rect.size.height = 160;
UITextView *textView;
textView = [[UITextView alloc] initWithFrame:rect];
//[textView setBackgroundColor:[UIColor cyanColor]];
[textView becomeFirstResponder];
[textView setScrollEnabled:NO];
[cell addSubview:textView];
[textView release];
[cell setNeedsLayout];
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment