ios中的用户注释 [英] Usernotes in ios

查看:111
本文介绍了ios中的用户注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中创建用户注释表单,目前正在使用一个textview在一个视图里面看起来很糟糕!是否有其他适合此目的的控制服?主要目的是当用户单击按钮时,将出现一个小的文本视图,他们可以在那里添加注释并将其保存到plist中. 我想要这样的东西(检查图片)

I want to create a user note form in my application,currently am using one textview inside a view its looking bad !! is there any other control suits for this purpose? Main aim is when user click the button a small textview will appear they can add comments there and save it into plist. I want something like this(check the image)

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

i want that kind of usernotes (its my image) please give me some advices and helps to develop this..

推荐答案

UIAlertViewUITextView一起使用可能对您有用.

Using UIAlertView with UITextView can be useful for you.

.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];
}

此处将以小的textview提醒您,您可以添加注释,然后像这样在委托方法中处理文本.

Here alert will be prompted with small textview you can add comments and then handle text inside delegate method like this.

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

这篇关于ios中的用户注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆