आप नीचे दिए गए कोड का उपयोग कर सकते हैं।
ज फ़ाइल में //
UITextField *loginId;
UITextField *password ;
// मीटर फ़ाइल में
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 2;
}
- (UITableViewCell *)tableView:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [table dequeueReusableCellWithIdentifier:@"Cell"];
if(cell == nil)
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"] autorelease];
if (indexPath.row == 0) {
loginId = [[UITextField alloc] initWithFrame:CGRectMake(5, 0, 280, 21)];
loginId .placeholder = @"loginid";
loginId .autocorrectionType = UITextAutocorrectionTypeNo;
[loginId setClearButtonMode:UITextFieldViewModeWhileEditing];
cell.accessoryView = loginId ;
}
if (indexPath.row == 1) {
password = [[UITextField alloc] initWithFrame:CGRectMake(5, 0, 280, 21)];
password.placeholder = @"Password";
password.secureTextEntry = YES;
password.autocorrectionType = UITextAutocorrectionTypeNo;
[password setClearButtonMode:UITextFieldViewModeWhileEditing];
cell.accessoryView = password;
}
loginId.delegate = self;
password.delegate = self;
[tableView1 addSubview:loginId];
[tableView1 addSubview:password];
[loginId release];
[password release];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
आपको इस नियंत्रण में भी रुचि हो सकती है जो पहले ही लिखा जा चुका है: http://cocoacontrols.com/platforms/ios/controls/ddalertprompt – Luke
यदि आप छवि अपलोड करना चाहते हैं तो आप नीचे दिए गए नियंत्रण का उपयोग कर सकते हैं जो लिंक में दिखाया गया है छवि: http://img31.imageshack.us/img31/566/screenshot20111015at317.png – User97693321