Comments (2)
Thanks @bianxiang @PhiltheHen, if the scroll view is the first child view of the view controller's view and the property automaticallyAdjustsScrollViewInsets
of the view controller sets to true
which can cause the problem.
There are two ways to solve this problem:
- Set
automaticallyAdjustsScrollViewInsets
tofalse
- Avoid the text view to be the first child view of the view controller's view
from kmplaceholdertextview.
Hey there @bianxiang, I ran into this issue as well when using IB. I noticed the content offset was changing after loading the view. I added the following line to layoutSubviews() in the placeholder view class:
setContentOffset(CGPoint(x: 0, y: 0), animated: false)
So the updated method looks like:
open override func layoutSubviews() {
super.layoutSubviews()
setContentOffset(CGPoint(x: 0, y: 0), animated: false)
placeholderLabel.preferredMaxLayoutWidth = textContainer.size.width - textContainer.lineFragmentPadding * 2.0
}
I hope that helps!
from kmplaceholdertextview.
Related Issues (20)
- Resizing based off placeholderLabel HOT 1
- Bad Access swift 3 HOT 1
- Add attributed placeholder
- Select Correct Word from Autocorrect window open when I select wrong spell word not working in UITextView iOS HOT 1
- Compiling has a error. HOT 2
- Arabic and Persian Chars HOT 2
- New version with support for swift4 HOT 1
- placeholder text color HOT 1
- Required code signature missing error
- Swift 4.2 and Xcode 10 HOT 8
- Swift Comiler Error
- YOUTUBE VIDEO TUTORIAL
- Swift 5 and Xcode 10.2 HOT 1
- clang: error: no such file or directory: 'KMPlaceholderTextView' HOT 1
- Swift package manager HOT 1
- Can't able to change placeholder on action
- paste not working
- No such module KMPlaceholderTextView HOT 1
- No SPM Support
- 请求添加PrivacyInfo.xcprivacy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kmplaceholdertextview.