wimagguc / ios-custom-alertview

Custom UIAlertView. Continue adding images and UIViews to dialogs in iOS7+
Other
1.66k stars 394 forks source link

Keyboard not appear #57

Open gbergamo opened 10 years ago

gbergamo commented 10 years ago

I'm adding a uitextview into a view, and add this view in ios7alertview content, and the keyboard does not appear. I'm doing something wrong, or there is a bug?

Code:

    int width = self.view.frame.size.width - 30;
    CustomIOS7AlertView *alertView = [[CustomIOS7AlertView alloc] initWithFrame:CGRectMake(0, 0, width, 130)];

    UIView *mainView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, 130)];

    UITextField *title = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, width, 30)];
    [title setTextAlignment:NSTextAlignmentCenter];
    [title setFont:[UIFont boldSystemFontOfSize:15]];
    [title setText:@"Reprove"];

    UITextField *message = [[UITextField alloc] initWithFrame:CGRectMake(0, 30, width, 30)];
    [message setTextAlignment:NSTextAlignmentCenter];
    [message setText:@"Message"];

    UITextView *textView = [[UITextView alloc]initWithFrame:CGRectMake(10, 60, width - 20, 60)];
    [textView.layer setCornerRadius:7];

    [alertView setContainerView:mainView];
    [mainView addSubview:title];
    [mainView addSubview:message];
    [mainView addSubview:textView];

    [alertView setUseMotionEffects:YES];

    [alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"Cancel", @"Reprove", nil]];
    [alertView show];
    [textView becomeFirstResponder];

I'm using xCode 6.1.1 and iOS 8.1

ios simulator screen shot dec 7 2014 19 59 04 (In this image, the textview are focused)

Thanks

raja-baz commented 9 years ago

Are you using the simulator for this? Do you get keyboard for any other text field? Might want to check the "Hardware => Keyboard => Connect Hardware Keyboard" setting. If it's on the simulator assumes there's an external hardware keyboard and no software keyboards show up inside, ever.

gclsoft commented 9 years ago

I've the same problem. After I click the textview, all the UI move to top of the iPad. I can't see the textview after click it

halise33a commented 2 years ago

It helps to generate some custom _design_ by using the Python program. I have made some samples of custom shaker keychain with it.