안녕을 치면있는 UITableViewCell에 UITextfields을 표시하는 방법 내가 UITableviewcell
세의 "+"기호를 클릭하면됩니다 나는 UITableviewCell
이 있고 나는 UITableviewcell
누군 요구 사항의 끝 부분에있는 "+"기호를 넣어 UITextfields는 다음에 표시됩니다 UITableviewcell
. 그리고 또한 처음에는 UITableviewcell
에 3 UITextfields
을 표시하고 싶습니다. 그리고 "+"기호는 모두 tableview
에 표시됩니다. 그러나 "+"기호를 동적으로 표시하려고합니다. 어떻게하면 도움이 될 수 있습니다. 이것은 내 코드입니다.사용자가 "플러스"기호
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
}
[cell.textLabel setText:@""];
UIButton *myGreenIconButton = [UIButton buttonWithType:UIButtonTypeCustom];
[myGreenIconButton addTarget:self action:@selector(GreenIconButtonClicked:)forControlEvents:UIControlEventTouchUpInside];
[myGreenIconButton setBackgroundImage:[UIImage imageNamed:@"index.jpg"] forState:UIControlStateNormal];
myGreenIconButton.backgroundColor = [UIColor clearColor];
myGreenIconButton.frame = CGRectMake(285, 28, 25, 25);
[cell addSubview:myGreenIconButton];
return cell;
}
제발 부탁드립니다. –