Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.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
Xcode ios中的Usernotes_Xcode_Storyboard_Uiactionsheet_Alertview_Notesview - Fatal编程技术网

Xcode ios中的Usernotes

Xcode ios中的Usernotes,xcode,storyboard,uiactionsheet,alertview,notesview,Xcode,Storyboard,Uiactionsheet,Alertview,Notesview,我想在我的应用程序中创建一个用户便笺表单,目前我在一个视图中使用一个textview它看起来很糟糕!!是否有其他针对该目的的控制诉讼?主要目的是当用户点击按钮时,会出现一个小的文本视图,他们可以在那里添加评论并将其保存到plist中。 我想要这样的东西(查看图片) 我想要那种用户注释(它是我的图像),请给我一些建议并帮助我开发它。使用UIAlertView和UITextView可以对您有用 在.h文件中实现UIAlertViewDelegate UITextView *comments; -(

我想在我的应用程序中创建一个用户便笺表单,目前我在一个视图中使用一个textview它看起来很糟糕!!是否有其他针对该目的的控制诉讼?主要目的是当用户点击按钮时,会出现一个小的文本视图,他们可以在那里添加评论并将其保存到plist中。 我想要这样的东西(查看图片)


我想要那种用户注释(它是我的图像),请给我一些建议并帮助我开发它。

使用
UIAlertView
UITextView
可以对您有用

在.h文件中实现
UIAlertViewDelegate

UITextView *comments;

-(IBAction)btnAddClicked:(id)sender
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Noreply Email" message:@"\n\n\n\n\n" delegate:self cancelButtonTitle:@"Close" otherButtonTitles:@"Send", nil];
    comments = [[UITextView alloc] initWithFrame:CGRectMake(15,45, 255, 100)];
    [comments setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"mailbody.png"]]];
    [comments setFont:[UIFont fontWithName:@"Helvetica" size:15]];
    comments.scrollEnabled = YES;
    [comments becomeFirstResponder];
    [alert addSubview:comments];
    [alert show];
    [alert release];
}
此处将使用小文本视图提示警报,您可以添加注释,然后像这样在委托方法中处理文本

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if(buttonIndex==1) //Send button pressed
    {
        //handle your comment here
        NSLog(@"%@",comments.text);
    }
}

:根据iOs开发,我们无法将AlertView用于用户输入,您在哪里读到过?我们中的许多人使用警报进行输入。甚至UIAlertView本身也有UIAlertViewStyleSecureTextInput、UIAlertViewStylePlainTextInput、UIAlertViewStyleLogin和PasswordInput输入样式。它们都说要显示相同链接的内容。。。