我该如何制作TextView_height=content_height+padding
当我向文本框添加一些顶部填充时 - 它将内容移动到TextView边框的后面。 这是对的,因为我使TextView与内容一样高。在Android中:如何强制TextView包装内容和填充
是否有可能使TextView与content + padding一样高?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
tools:context=".DisplayActivity" >
<TextView
android:id="@+id/TopmessageStripe"
style="@style/TopmessageStripeTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignWithParentIfMissing="false"
android:layout_centerHorizontal="true"
android:height="@dimen/big_margin"
android:paddingTop="5dp"
android:text="TextView" />
</RelativeLayout>
您可以粘贴xml定义吗? – yarakyo