问题是当突出显示不可编辑的textVIEw时,输入附件视图出现…(为什么!?)就像tableVIEw突然成为第一个响应者一样,我猜测因为其中一个子视图已成为第一响应者.问题是,我是否需要从tableVIEws子视图中取出这个不可编辑的textVIEw,或者是否有某种方法可以在突出显示时抑制inputAccessoryVIEwd出?后者是首选.
-(UITextVIEw *)textVIEw{ if (!_textVIEw) { _textVIEw = [[UITextVIEw alloc]initWithFrame:CGRectZero]; //_textVIEw.delegate = self; _textVIEw.Font = [UIFont questionDemiBoldFontOfSize:36.0f]; _textVIEw.backgroundcolor = [UIcolor clearcolor]; _textVIEw.editable = NO; _textVIEw.scrollEnabled = NO; _textVIEw.textcolor = [UIcolor whitecolor]; _textVIEw.tintcolor = [UIcolor whitecolor]; _textVIEw.autoresizingMask = UIVIEwautoresizingFlexibleBottommargin | UIVIEwautoresizingFlexibleRightmargin; } return _textVIEw;}解决方法 这对我来说在UITextVIEw子类中起作用.斯威夫特4
overrIDe func becomeFirstResponder() -> Bool { guard isEditable else { return false } return super.becomeFirstResponder()}总结
以上是内存溢出为你收集整理的ios – 突出显示uitextview显示inputAccessoryView全部内容,希望文章能够帮你解决ios – 突出显示uitextview显示inputAccessoryView所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)