开发者

UITextView Text alignmnet at Top

I'm using UITextView to display a text read from XML file. On click of a button, it will read next entry from XML file and replaces text in text view accordingly. Its working fine. But the trouble is that, some times, the text starts at 0,0 location in text view and some times, its leaving some space at the top of text view and displaying text. How can I force text to align to the top of text view. Also how can I make text view to leave some padding at the开发者_如何学运维 top?


I have something similar with scrollable images loading based on user input, which may or may not help. Every time the user changes the image I call:
[YourTextView setContentOffset:CGPointZero];

It might help reset the positioning of the text view.


Use this : self.nameTextView.contentInset = UIEdgeInsetsMake(0,0,0,0);


did you try with [<#Your textview#> sizeToFit];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜