이와 같은보기에서 UITextField를 생성하려고합니다. IB를 사용하거나 프로그래밍 방식으로 사용해도 상관하지 않습니다.어떻게 "double"UITextField를 구현할 수 있습니까?
alt text http://echofon.com/img/twitter/iphone/setup.png
이와 같은보기에서 UITextField를 생성하려고합니다. IB를 사용하거나 프로그래밍 방식으로 사용해도 상관하지 않습니다.어떻게 "double"UITextField를 구현할 수 있습니까?
alt text http://echofon.com/img/twitter/iphone/setup.png
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 2; }
- (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]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } if(indexPath.row == 0) { cell.textLabel.text = @"Username"; UITextField *field = [[[UITextField alloc] initWithFrame: CGRectMake(120, 10, 180, 30)] autorelease]; [cell addSubview:field]; } else if(indexPath.row == 1) { cell.textLabel.text = @"Password"; UITextField *field = [[[UITextField alloc] initWithFrame: CGRectMake(120, 10, 180, 30)] autorelease]; field.secureTextEntry = YES; [cell addSubview:field]; } return cell; }
- (NSString *)tableView: (UITableView *)tableView titleForHeaderInSection: (NSInteger)section { return @"Account"; }
- (NSString *)tableView: (UITableView *)tableView titleForFooterInSection: (NSInteger)section { return @"If you don't have a twitter account, go to twitter.com to sign up."; }
당신은이 효과를 달성하기 위해 테이블의 내부 UITextField에 객체를 배치해야합니다. 자세한 내용은 jQuery과를 참조하십시오 http://developer.apple.com/iphone/library/DOCUMENTATION/UIKit/Reference/UITableView_Class/Reference/Reference.html
놀라운! 고맙습니다! –