0

Android のテキスト ビューの前にマージンを追加する必要がありますが、Android:layout_marginLeft/Right を使用すると機能しません。そうする別の方法はありますか?

<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="7dip"
        android:paddingRight="27dip"
        android:paddingTop="7dip"
        android:text="Name"
        android:textColor="#10a6a4"
        android:textSize="20dp"
        android:layout_marginRight="40dp"
        android:textStyle="bold" />
4

1 に答える 1

0

使用していRelativeLayoutますか?マージンとパディングは(私が知る限り)RelativeLayoutsでは機能しません。LinearLayout代わりに試してみてください。またはandroid:layout_aboveandroid:layout_bellowまたはこれらのものを使用している場合は、txtViewとパディング元のビューを1つの新しいLinearLayoutに配置してください。私が助けてくれたことを願っています。

于 2012-10-27T19:45:02.593 に答える