gpt4 book ai didi

iphone - 如何在 UITableView (UITableViewCell) 中使用 UITextField 实现类似的 UI?

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:24:26 25 4
gpt4 key购买 nike

我希望在 UITableViewCell(在 UITableView 中)中使用 UITextField 来模仿以下 UI。我是 MonoTouch 的新手,我似乎无法弄清楚代码会是什么样子。

enter image description here

最佳答案

这很简单。只需向单元格添加一个没有背景颜色的UITextField。在您的 cellForRowAtIndexPath 方法中添加以下代码。

UITextField *inputText = [[UITextField alloc]initWithFrame:CGRectMake(10,10,280,22)];
inputText.textAlignment = UITextAlignmentLeft;
inputText.backgroundColor = [UIColor clearColor];
inputText.placeHolder = @"Street";
[cell.contentView addSubview:inputText];
[inputText release];

关于iphone - 如何在 UITableView (UITableViewCell) 中使用 UITextField 实现类似的 UI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5227815/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com