设置文本时TextView下方的空白区域

时间:2014-02-08 11:01:45

标签: android android-layout

当我在AutoResizeTextView(id textearticlecomplet)中设置一个长文本时,文本在textview内部,但在它下面,有一个很长的空白区域。但是,文本不包含此空格。

我在哪里犯了错误?

以下是布局代码:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#EDE5E2"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/imagedetailarticle"
            android:layout_width="fill_parent"
            android:layout_height="230dp"
            android:scaleType="centerCrop"
            android:src="@drawable/ic_action_picture" />

        <TextView
            android:id="@+id/titleaticledetail"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="12dp"
            android:layout_marginRight="12dp"
            android:layout_marginTop="4dp"
            android:text="TextView"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <TextView
            android:id="@+id/sourcedetailarticle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="4dp"
            android:layout_marginLeft="12dp"
            android:layout_marginRight="12dp"
            android:layout_marginTop="9dp"
            android:text="Medium Text"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textSize="14sp" />

        <com.rss.utils.AutoResizeTextView
            android:id="@+id/textearticlecomplet"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="6dp"
            android:layout_marginLeft="12dp"
            android:layout_marginRight="12dp"
            android:layout_marginTop="6dp"
            android:lineSpacingMultiplier="1.2"
            android:text="Chargement en cours ..."
            android:textSize="18sp" />

        <TextView
            android:id="@+id/articleoriginal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginBottom="15dp"
            android:clickable="true"
            android:onClick="onClick"
            android:text="Consulter l&apos;article sur le web"
            android:textColor="@color/consulteroriginal"
            android:textSize="16sp"
            android:textStyle="italic" />

    </LinearLayout>

</ScrollView>

2 个答案:

答案 0 :(得分:0)

从您的(com.rss.utils.AutoResizeTextView)

中删除它
android:layout_marginBottom="6dp"

答案 1 :(得分:0)

是的@Sagar似乎是正确的。 xml中出现的唯一额外空间是marginBottom。删除它,它应该做。

相关问题