Note that there are some explanatory texts on larger screens.

plurals
  1. POInputAccessoryView with disappearing buttons
    primarykey
    data
    text
    <p>I have this InputAccessoryView appearing for a textview and it works fine. However if I click the shareButton on the accessoryview and then hit cancel to continue writing, the accessoryview gets empty. It still appears as a toolbar but all the buttons are gone, what am I doing wrong here? </p> <pre><code>- (BOOL)textViewShouldBeginEditing:(UITextView *)textView { UIToolbar *toolbar = [[UIToolbar alloc] init]; [toolbar setBarStyle:UIBarStyleBlackOpaque]; [toolbar sizeToFit]; UIBarButtonItem *shareButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(shareIt:)]; UIBarButtonItem *flexButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil]; UIBarButtonItem *doneButton =[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(resignKeyboard)]; NSArray *itemsArray = [NSArray arrayWithObjects:shareButton, flexButton, doneButton, nil]; [toolbar setItems:itemsArray]; [_textView setInputAccessoryView:toolbar]; return YES; } </code></pre> <p>and this is the method shareIt:</p> <pre><code>- (void)shareIt:(id)sender { NSArray *activityItems; activityItems = @[_textView.text]; UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil]; [self presentViewController:activityController animated:YES completion:nil]; NSLog(@"buttonCalle"); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload