【问题标题】:Usernotes in iosios中的用户注释
【发布时间】:2013-03-23 05:40:49
【问题描述】:

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

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

【问题讨论】:

    标签: xcode storyboard uiactionsheet alertview notesview


    【解决方案1】:

    UIAlertViewUITextView 结合使用可能对您有用。

    在 .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提示alert,你可以添加cmets,然后像这样在委托方法中处理文本。

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-28
    • 2012-07-15
    • 1970-01-01
    • 1970-01-01
    • 2012-12-05
    • 1970-01-01
    • 2023-03-25
    相关资源
    最近更新 更多