[英]NSTextView (inside NSScrollView) - how can i know if scrollbar is required?
在NSTextView对象中设置字符串后,可以确定是否显示滚动条吗?
Simply compare the height of the NSTextView
to the height of the NSScrollView
. 只需将NSTextView
的高度与NSScrollView
的高度进行比较NSScrollView
。
if ([textView frame].size.height > [scrollView frame].size.height) {
//Scrollbar will be shown.
}
else {
//Scrollbar will not be shown.
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.