开发者

Stop image expanding in multiline table row? #2

开发者 https://www.devze.com 2023-03-17 19:26 出处:网络
[Ok I\'ve had to ask this question again as the first time I was unregistered, and I can\'t seem to register and link my fb id to that account/or give feedback on my question otherwise! Any way here\'

[Ok I've had to ask this question again as the first time I was unregistered, and I can't seem to register and link my fb id to that account/or give feedback on my question otherwise! Any way here's the original question, and extra info - original url: Stop image expanding in multiline table row? ]

I'm having problems implementing a table row that allows text to wrap to multiple lines, and also has an image on the left, a开发者_Python百科nd a disclosure accessory on the right.

The multiline text is fine but the imageView expands to the right when there is more than one line of text. I want images in all rows to be the same size. I've tried setting the autoresizingMask to UIViewAutoresizingNone but this doesn't seem to work.. Do I need to use the contentView, or a nib file?

Any help/example code appreciated!

EXTRA: HaveYouMetPrabu's answer to my original question kinda worked - but so did my current code UNTIL I changed the row height in heightForRowAtIndex path for rows with more than one line of text (even using an autoresizingMask of UIViewAutoresizingNone) - then the image expands to the right. So I think the solution needs to include both the cellForRow.. & heightForRow.. methods. My current heightForRow.. implementation is probably too simple just switching between 2 fixed row heights depending on the text length..?

0

精彩评论

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

关注公众号