Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/109.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios ipad弹出窗口,可输入文本字段_Ios_Ipad_Styles_Uitextfield_Popover - Fatal编程技术网

Ios ipad弹出窗口,可输入文本字段

Ios ipad弹出窗口,可输入文本字段,ios,ipad,styles,uitextfield,popover,Ios,Ipad,Styles,Uitextfield,Popover,我为ipad设计了一款弹出式(桌面视图风格)。现在就像在asp.net中一样,我希望在末尾有一个选项,这样,如果用户单击它,他就可以在其中输入值。可以吗?如果可以,怎么做?我玩过tableviewcellstyles,也有一个文本框,但适用于所有选项。如果有人这样做了,你能给我一些想法吗。谢谢 编辑:我应该提到我正在使用Monodevelop开发此应用程序。一种方法,假设您使用故事板创建视图并设置属性: 在UITableView对象属性中,将“内容”属性设置为“动态原型” 然后从序列图像板编辑器

我为ipad设计了一款弹出式(桌面视图风格)。现在就像在asp.net中一样,我希望在末尾有一个选项,这样,如果用户单击它,他就可以在其中输入值。可以吗?如果可以,怎么做?我玩过tableviewcellstyles,也有一个文本框,但适用于所有选项。如果有人这样做了,你能给我一些想法吗。谢谢


编辑:我应该提到我正在使用Monodevelop开发此应用程序。

一种方法,假设您使用故事板创建视图并设置属性:

在UITableView对象属性中,将“内容”属性设置为“动态原型”

然后从序列图像板编辑器的UI对象列表向表中添加一个额外的表视图单元格(就像添加另一个标签或按钮或其他任何东西一样)

现在,表视图中应该有两个TableViewCell对象。如果没有,请添加另一个

为两个表视图单元格对象指定不同的标识符(即,将每个对象的属性“标识符”设置为不同的字符串)

设置第一个单元格以显示正常内容

设置第二个单元格以显示唯一的“最后一行”布局

在代码中,在cellForRowAtIndexPath中,返回大多数行的“主”单元格,但最后一行的备用单元格:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // rows are 0-indexed
    if (indexPath.row == myDataSource.count) {

        NSString *CellIdentifier = @"AlternateCell";

        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

        // populate contents...
    }
    else {

        NSString *CellIdentifier = @"NormalRow";

        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

        // populate contents...
    }
}
为此,您必须告诉TableView,有一行比实际数据多:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return myDataSource.count +1;
}

谢谢我应该提到我使用Monodevelop作为IDE。你以前用过它吗?