Q
如何创建这样的
1
A
回答
1
是否所有的这在用的UITableViewController -
UITableViewDelegate, UIPickerViewDelegate, UITableViewDataSource, UIPickerViewDataSource -
对于病人& ACC =>设定的UITextField作为一个子视图(执行此操作在的cellForRowAtIndexPath为各自的行)
出生和Date =>分别使用UIDatePickerView和行== 2和行== 4。
For Modality =>我不知道你是什么意思;但你需要做类似的事情
为了获得其他两个值的另一部分;返回节= 2
(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
,并为那些相应设置标题(如果需要)
代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(110, 10, 185, 30)];
textField.clearsOnBeginEditing = YES;
textField.textAlignment = UITextAlignmentRight;
textField.returnKeyType = UIReturnKeyDone;
textField.delegate = self;
[cell.contentView addSubview:textField];
if (indexPath.row == 2)
{
UIDatePicker *datePicker = [[UIDatePicker alloc] init];
datePicker.datePickerMode = UIDatePickerModeDate;
[datePicker addTarget:self action:@selector(datePickerValueChangedd:) forControlEvents:UIControlEventValueChanged];
datePicker.tag = indexPath.row;
textField.inputView = datePicker;
NSDateFormatter *df = [[NSDateFormatter alloc] init];
df.dateStyle = NSDateFormatterMediumStyle;
NSString *local;
local = [self datePickerValueChangedd: datePicker];
NSLog(@"%@", local);
textField.text =local;
[datePicker reloadInputViews];
[datePicker release];
}
}
// Configure the cell...
NSInteger row = [indexPath row];
cell.textLabel.text = [doseInfoDetailsArray objectAtIndex:row];
return cell;
}
0
你可以采取的UITableView与风格的自定义的UITableView “组”可以有3个部分。
相关问题
- 1. 如何创建这样
- 2. 如何创建这样
- 3. 创建这样
- 4. 如何创建这样的CakePHP
- 5. 如何创建这样的界面?
- 6. 如何创建这样的东西
- 7. PHP - 如何创建这样的数组?
- 8. 如何创建这样的布局?
- 9. 如何创建这样的查询?
- 10. 如何创建这样的链接
- 11. 如何创建这样的文本?
- 12. 如何创建这样的布局?
- 13. 如何创建这样的共享栏?
- 14. 如何创建这样的动画gif?
- 15. 如何创建这样的布局?
- 16. 如何创建一个Lightbox这样的
- 17. 如何创建这样的测验?
- 18. 如何创建AngelList这样的网站?
- 19. 如何创建布局这样
- 20. 如何创建这样一个XSD
- 21. 如何创建这样使用JavaScript
- 22. 如何创建一个像这样的文本更改的DLL?
- 23. Joomla的这样的痛苦......如何创建文件夹
- 24. 创建一个这样的HTML表格
- 25. 创建一个像这样的滑块?
- 26. 如何在Mac OS上创建这样的界面?
- 27. 如何创建像这样的gridview列表项目
- 28. 如何创建一个像这样的表格
- 29. 如何创建一个像这样的PPT幻灯片?
- 30. 如何在MS Word中创建这样的表格?
ü可以给我说 – AMH 2011-06-02 14:01:09
见代码示例代码以上并相应地使用它 – Legolas 2011-06-02 14:04:09
所以......它有用吗?我还有一个建议。在textFieldDidBeginEditing中使用datePicker方法。您可以使用PickerView中的值设置日期。 – Legolas 2011-06-02 15:05:25