开发者

Add text view and image view desirable place

开发者 https://www.devze.com 2023-04-05 12:46 出处:网络
I have create an iPhone quiz application .Some of the questions have question image and some have only text. I have take a text view for displaying question and an image view for displaying question i

I have create an iPhone quiz application .Some of the questions have question image and some have only text. I have take a text view for displaying question and an image view for displaying question image开发者_如何学JAVA . But problem is that when small sized question is appear then there have big gap between question and image. But i want to set same distance for all sized questions. How can i do that. please help me to solve this .Thanks in advance.


Use the NSString method sizeWithFont:forWidth:lineBreakMode: to get the height of your text, and then just add that on to the y value of the image/text.

0

精彩评论

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