0

デフォルトでは、TextViews には、削除方法がわからない組み込みのパディングが含まれているようです。たとえば、これは私のアプリでユーザーに表示されるものです。

マイログイン

Pinterest レイアウトで、以下のように 2 つの TextView を連続したブロックにしたいと考えています。

Pinterest ログイン

どうすればこれを達成できますか?



更新: 最終的に、解決策は背景を手動で設定し、次のようなセパレータを使用することでした:

    <EditText
        android:padding="10dp"
        android:id="@+id/login_name"
        android:lines="1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="0dp"
        android:hint="@string/nnn"
        android:background="#FFf0f0f0"
        android:imeOptions="actionNext" >
        <requestFocus />
    </EditText>

    <View android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#FFd1d1d1"/>
    <View android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#FFFFFFFF"/>

    <EditText
        android:padding="10dp"
        android:id="@+id/password"
        android:layout_width="match_parent"
        android:layout_marginTop="0dp"
        android:inputType="textPassword"
        android:hint="@string/enter_password"
        android:layout_height="wrap_content"
        android:imeOptions="actionDone"
        android:background="#FFf0f0f0"
        />
4

2 に答える 2

2
  1. レイアウト ファイルのとからとを削除 ( に設定0) します。marginpaddingTopBottomxml

  2. 背景を無地の白に設定し、いくつかの境界線または<view>区切りを追加します。

于 2013-03-13T01:13:25.147 に答える
1

TextViewの背景を必要なものに変更するだけです。そして、それはトリックを行います。android:backgroundを白いボックスに設定するだけで、余白が削除されます。

于 2013-03-13T01:13:46.347 に答える