我有一个自定义布局的列表视图。在布局中,我会显示一系列评论。问题在于,当评论太长时,背景会变得很紧张,因此我设置了这个图像。图像渲染九个补丁
我知道我可以使用九个补丁,但问题是它真的有效吗?如果不是我有什么替代方案?
有人可以推荐最好的处理方法。
<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>
我该如何“垫顶”,以便其余部分不会缩放? – Hades 2011-06-01 09:40:15
看看android:padding或setPadding - http://developer.android.com/reference/android/view/View.html#setPadding%28int,%20int,%20int,%20int%29 – 2011-06-01 10:11:53
我已添加填充到顶部。参考代码。但它仍然可以扩展整个图像。 – Hades 2011-06-01 10:52:42