iphone - Get physical location of text in UILabel -
iphone - Get physical location of text in UILabel -
i know how find size of text using sizewithfont
want find actual highest point , lowest point of text has been drawn in uilabel
.
i need add together artificial cursor view uilabel
within it. problem text in uilabel
seems alter top , bottom margins arbitrarily. can't work out how os works out position text in uilabel
.
so great able create category or method works out y axis pixel origin of actual text drawn onto view.
is possible @ all? how uitextfield position text , cursor perfectly?
update
i thinking might possible getting uilabel context , finds whitespace @ top, should give me y pixel origin of actual text right? have no thought start though, or create efficient plenty not inhibit frequent changes uilabel.
many thanks.
do need utilize uilabel or utilize disabled uitextview?
for text view like
cgrect rect = [textview.layoutmanager usedrectfortextcontainer:textview.textcontainer];
this should give want. if memory serves rect returns relative text view.
hope helps :)
iphone ios ipad uilabel
Comments
Post a Comment