简体   繁体   中英

How to hide/show UITextView in iOS Swift4

textView.isHidden = true //false

I'm trying to hide/show UITextView by setting isHidden but it doesn't work properly. It does hide the UITextView but it still shows an area where the previous content was. See the image below. The right side is where I'm hiding, the view is hidden as we don't see pink view, but it looks like it still has content area in it. Any idea how to hide UITextView completely including it's content? I did search but couldn't find any solution.

在此处输入图片说明

将这些视图设置在单个堆栈中,因此如果您隐藏一个视图,它将自动将其容器与剩余元素一起排列。

你应该改变 textview 的高度

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM