1

水平方向の LinearLayout に imageview と textview があります。テキストビューの左側に削除できないスペースがある理由がわかりません...パディング、重力などでテストしました...

これは私のxmlで、画像になります

何か案が?

ありがとうございました!

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="left|center_vertical"
    android:orientation="horizontal" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="horizontal" >

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/dot" />

        <TextView
            android:id="@+id/text_resultado"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="sans-serif-light"
            android:gravity="center"
            android:padding="3dp"
            android:text="TextView"
            android:textColor="@color/negroLetras"
            android:textSize="@dimen/titles" />
    </LinearLayout>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="sans-serif-light"
        android:paddingBottom="3dp"
        android:paddingRight="3dp"
        android:paddingTop="3dp"
        android:text="%"
        android:textColor="@color/negroLetras"
        android:textSize="@dimen/titles" />

</LinearLayout>

ここに画像の説明を入力

4

3 に答える 3

1

おそらく、描画可能な「ドット」または dimen などの他の値に何か問題があると思います。この値を使用せずに他のサンプル値とレイアウトを使用してコードを使用したため、レイアウトは問題なかったと思います。

于 2013-09-25T11:29:25.680 に答える
0

コードに問題はありません。あなたのコードは完璧です。あなたの問題がイメージにありますように。確認するか、他のものと交換してから確認してください。

于 2013-09-25T11:35:31.673 に答える
0

レイアウトを少し変更することをお勧めしますか?

2 番目の LinearLayout を削除し、次のように TextView を使用します。

<TextView
    android:id="@+id/text_resultado"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:drawableLeft="@drawable/dot"
    android:fontFamily="sans-serif-light"
    android:gravity="center"
    android:padding="3dp"
    android:text="TextView"
    android:textColor="@color/negroLetras"
    android:textSize="@dimen/titles" />
于 2013-09-25T11:35:51.230 に答える