Usernotes in ios
Asked Answered
U

1

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..

Upswing answered 23/3, 2013 at 5:40 Comment(0)
P
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);
    }
}
Polychrome answered 23/3, 2013 at 5:46 Comment(4)
:According to iOs development we cannot use AlertView for user inputUpswing
Where have read this ? Many of us using alert for input. Even developer.apple.com/library/IOs/#documentation/UIKit/Reference/… UIAlertView it self has UIAlertViewStyleSecureTextInput, UIAlertViewStylePlainTextInput, UIAlertViewStyleLoginAndPasswordInput styles for input.Salverform
They all saying about displaying contentsUpswing
the same link ...developer.apple.com/library/ios/#documentation/UIKit/Reference/…Upswing

© 2022 - 2024 — McMap. All rights reserved.