开发者

image rendering nine patch

开发者 https://www.devze.com 2023-03-09 13:33 出处:网络
I have a list view with a custom layout. In the layout I display a series of comments. The problem is the image I\'ve set as the background gets st开发者_运维知识库retched when the comments are too lo

I have a list view with a custom layout. In the layout I display a series of comments. The problem is the image I've set as the background gets st开发者_运维知识库retched when the comments are too long.

I know I could probably use a nine patch but the question is would it really work? If not what alternative do I have?

Could someone recommend the best of handling this.

image rendering nine patch

image rendering nine patch

<TextView android:id="@+id/txtCommentBody" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:textColor="@color/black" android:paddingTop="25dip" android:paddingLeft="5dip" android:paddingRight="5dip" android:layout_marginTop="10dip" android:background="@drawable/comment_bg"> </TextView>


A nine-patch would work provided you pad the top of your text so it's below the part that won't scale. Alternatively, truncate all your comments to some reasonable length that will fit, and let people click them to read the whole thing.

0

精彩评论

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