2

enter image description hereI 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. enter image description here 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..

Naveen
  • 1,251
  • 9
  • 20
  • 38

1 Answers1

0

Using UIAlertView with UITextView can be useful for you.

Implement UIAlertViewDelegate in .h file.

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

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);
    }
}
βhargavḯ
  • 9,786
  • 1
  • 37
  • 59
  • :According to iOs development we cannot use AlertView for user input – Naveen Mar 23 '13 at 05:48
  • Where have read this ? Many of us using alert for input. Even http://developer.apple.com/library/IOs/#documentation/UIKit/Reference/UIAlertView_Class/UIAlertView/UIAlertView.html UIAlertView it self has UIAlertViewStyleSecureTextInput, UIAlertViewStylePlainTextInput, UIAlertViewStyleLoginAndPasswordInput styles for input. – βhargavḯ Mar 23 '13 at 05:58
  • They all saying about displaying contents – Naveen Mar 23 '13 at 06:04
  • the same link ...https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIAlertView_Class/UIAlertView/UIAlertView.html – Naveen Mar 23 '13 at 06:11