Advertisement
Guest User

Untitled

a guest
Sep 17th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  2.  
  3. static NSString *CellIdentifier = @"Cell";
  4. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  5. if (cell == nil) {
  6. cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
  7. }
  8.  
  9. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  10.  
  11. tableView.scrollEnabled=NO;
  12.  
  13. if (indexPath.row==0) {
  14. enterUserName=[[UITextField alloc]initWithFrame:CGRectMake(10, 10, 290, 24)];
  15. enterUserName.placeholder=@"Username";
  16. [enterUserName setBorderStyle:UITextBorderStyleNone];
  17. enterUserName.clearButtonMode = UITextFieldViewModeWhileEditing;
  18. enterUserName.keyboardType=UIKeyboardTypeDefault;
  19. enterUserName.returnKeyType=UIReturnKeyDone;
  20. enterUserName.delegate=self;
  21.  
  22. [cell.contentView addSubview:enterUserName];
  23. }
  24. if (indexPath.row==1) {
  25. enterPassWord=[[UITextField alloc]initWithFrame:CGRectMake(10, 10, 290, 24)];
  26. enterPassWord.placeholder=@"Password";
  27. [enterPassWord setBorderStyle:UITextBorderStyleNone];
  28. enterPassWord.clearButtonMode = UITextFieldViewModeWhileEditing;
  29. enterPassWord.keyboardType=UIKeyboardTypeDefault;
  30. enterPassWord.returnKeyType=UIReturnKeyDone;
  31. [enterPassWord setSecureTextEntry:YES];
  32. enterPassWord.delegate=self;
  33.  
  34. [cell.contentView addSubview:enterPassWord];
  35. }
  36. return cell;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement