soffes / sstoolkit

A collection of well-documented iOS classes for making life easier
MIT License
3.31k stars 573 forks source link

Fixed placeholder position for SSTextField on iOS 7 #193

Closed xzenon closed 11 years ago

xzenon commented 11 years ago

In iOS7 all methods like like drawInRect:withFont: are deprecated and give the wrong text appearance (always aligned to top). Rect should be adopted for vertically centering text.

Example of incorrect placeholder position: Placeholder

Added rect adjustments for iOS 7 as adviced here:

CGRectInset(rect, 0, (rect.size.height - self.font.lineHeight) / 2.0);
jstart commented 11 years ago

I believe this commit should be merged instead with https://github.com/soffes/SAMTextField as SSToolkit is being broken into seperate libraries. Fork that repo and make the same changes, if you have time! It would be greatly appreciated!

xzenon commented 11 years ago

I see. Made proper changes and added pull request for SAMTextField. Thanks!