0

テキストボックスにトップパディングを追加するTextView_height=content_height+padding と、コンテンツが TextView の境界線の後ろに移動します。TextView をコンテンツと同じ高さにしたので、これは正しいです。

TextView をコンテンツ + パディングと同じ高さにすることは可能ですか?

<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>

ここに画像の説明を入力

4

2 に答える 2

2

これはおそらくあなたの問題です

android:height="@dimen/big_margin"

コンテンツをラップする代わりに、カスタムの高さを設定しています。

于 2013-08-01T11:59:30.550 に答える