gpt4 book ai didi

ios - inputaccessoryview 未显示( Storyboard)

转载 作者:行者123 更新时间:2023-11-29 03:27:29 25 4
gpt4 key购买 nike

我一直在尝试在我的键盘上方合并一个 UIView/Toolbar 但没有成功。当我添加一个工具栏时,它被打乱了,因此我需要将它放入 UIViewUIView 不想出现在键盘上方。代码如下:

我的标题:

 @property (nonatomic, Strong) IBOutlet UITextView *textView;
@property (nonatomic, strong) IBOutlet UIToolbar *TitleBar;
@property (nonatomic, weak) IBOutlet UIView *AddView;

ViewDidLoad:

- (void)viewDidLoad
{
// observe keyboard hide and show notifications to resize the text view appropriately
/*[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
*/

if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
// iOS 7
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
} else {
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}

self.attributionTitle.delegate = self;
self.attribution.delegate = self;
textView.scrollEnabled = YES;
// quoteText.layer.borderColor = [UIColor blackColor].CGColor;
// quoteText.layer.borderWidth = 1.0f;

// textView.delegate = self; // code or in IB

[textView becomeFirstResponder];

[super viewDidLoad];
// Do any additional setup after loading the view.
}

textViewDidBeginEditing:

-(void)textViewDidBeginEditing:(UITextView *)textView
{
self.textView.inputAccessoryView = self.AddView;
}

此处显示 UIView 已连接:enter image description here

最佳答案

我将 textView.inputAccessoryView = AddView; 添加到 ViewDidLoad,然后从 Storyboard中删除该 View 并重新制作它。最后,我将 UIView 添加到底部黑条。

关于ios - inputaccessoryview 未显示( Storyboard),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20272907/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com