A lot of the times, you're dealing with UITextViews and UITextFields that have the same white background and border as the superviews they sit on top of. It's helpful every now and then to make sure they're obeying the constraints you want them to have. In my case, I made a self-contained UITextView that has a placeholder functionality but the textView wasn't constraining to the size of its container view.
DOH!
Ahh... needed better constraints:
func applyConstraintsToTextView() {
if let validTextView = self.placeholderTextView {
let viewsDictionary = ["textView":validTextView]
self.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[textView]|", options: [], metrics: nil, views: viewsDictionary))
self.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[textView]|", options: [], metrics: nil, views: viewsDictionary))
setNeedsLayout()
}
}
Now add this extension to UIView
extension UIView {
func drawRedBorder() {
self.layer.borderColor = UIColor.redColor().CGColor
self.layer.borderWidth = 1.0;
}
}
simply call it on the view (any UIView subclass) and see where the borders are landing.
validTextView.drawRedBorder()
Much better...
To buy a second hand mobile is not easy when you have no idea about the mobile phone price. So you can search in Quikads; a classified ads platform in Bangladesh. Where you will get so many ideas about second hand mobile phone prices in Bangladesh.
ReplyDeleteBike mayhem is a free and easy to use modification for Android that allows users to do things like speed up, slow down, or reverse the direction of their bike while riding. This app is great for those who want to have some fun while cycling, and it's also great for people who want to learn how to use their bike more efficiently. For more Info visit us at https://apktreee.com/bike-mayhem-mod-apk/
ReplyDelete