1

在我的应用程序的添加联系人页面中,我接受了联系人的地址。单击“添加其他地址”按钮时,我有添加其他地址的功能。这个概念是用户可以添加任意数量的附加地址。用户必须继续单击按钮以打开一个单独的 UIView,其中包含字段 req 以接受额外的地址。因此,用户必须单击“添加其他地址”按钮才能继续添加地址。必须有一个 UIView 必须在单击按钮时一次又一次地使用吗?这个怎么做?

4

2 回答 2

0

只需创建一个 UIView 类 alloc init 并添加子视图并在添加每个视图后增加 y 偏移量

于 2013-09-05T10:16:37.580 回答
0

这就是我创建动态textfeilds的方式,你可以生成uiview

-(void)dynamicTextfeildsPhone
{
    string = Points.text;
    Pointsvalue = [string intValue];
    txtFldFrame1 = [[UITextField alloc] initWithFrame:CGRectMake(45,130,60,30)];
    for (x=1; x <= Pointsvalue ; x++)
    {
        txtFldFrame1=[[UITextField alloc]initWithFrame:CGRectMake(45,txtFldFrame1.frame.origin.y+34,60,30)];
        txtFldFrame1.borderStyle=UITextBorderStyleRoundedRect;
        txtFldFrame1.keyboardType=UIKeyboardTypeNumbersAndPunctuation;
        txtFldFrame1.tag = 1;
        txtFldFrame1.delegate=self;
        [ScrollLag addSubview:txtFldFrame1];

    }
}
于 2013-09-05T10:20:58.803 回答