2012-11-07 26 views
1

好了,这是什么我有:的android TextView中删除隐含利润

enter image description here

,这就是我想要的:

enter image description here

<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="match_parent" > 

    <TextView 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentTop="true" 
     android:text="3" 
     android:textSize="500px" 
     android:includeFontPadding="false" 
     android:paddingTop="0px" 
     android:paddingBottom="0px" 
     android:paddingLeft="0px" 
     android:paddingRight="0px" 
     android:layout_marginTop="0px" 
     android:layout_marginBottom="0px" 
     android:layout_marginLeft="0px" 
     android:layout_marginRight="0px" 
     android:background="@null" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 
    </TextView> 
</RelativeLayout> 

正如你所看到的,我使用了所有已知的魔法:includeFontPadding,background="@null",边距,填充物等。我错过了什么?

+0

尝试使用的LinearLayout和认沽的TextView –

回答

0

试举高度和宽度的wrap_contant代替match_parent

+0

没有帮助 – Nick

0

您可以使用

<TextView 
     android:id="@+id/text1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="3" 
     android:textSize="500px" 
android:background="@null" 
     android:paddingTop="0px" 
     android:gravity="top"> 

    </TextView> 
+0

你测试它在设备?它不帮助我。我有一个运行Android 4.1.2的Google Nexus 7。 – Nick

+0

不,我没有在设备上测试它。 – Numair