image rendering nine patch
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.
<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.
精彩评论