2014-01-09 89 views
2

有人可以請解釋一下嗎?
爲什麼第三個TextView很奇怪? enter image description hereAndroid文本視圖 - 剪掉頂部和底部邊緣

爲2號線的定義之前都是一樣的,我也沒碰過用java風格...

編輯:我已經添加了XML佈局文件。 的XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/rl" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="top" > 

    <TextView 
     android:id="@+id/quadEqu" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="25dp" 
     android:text="@string/quadequ" 
     android:textSize="27sp" /> 

    <Button 
     android:id="@+id/closeBtn" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" 
     android:layout_marginBottom="30dp" 
     android:text="@string/close" 
     android:onClick="close" /> 

    <TextView 
     android:id="@+id/stepOne" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/quadEqu" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="25dp" 
     android:text="@string/quadEquForm" 
     android:textSize="18sp" /> 

    <TextView 
     android:id="@+id/stepTwo" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignLeft="@+id/stepOne" 
     android:layout_below="@+id/stepOne" 
     android:text="@string/quadEquForm" 
     android:textSize="18sp" /> 

    <TextView 
     android:id="@+id/stepThree" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignLeft="@+id/stepOne" 
     android:layout_below="@+id/stepTwo" 
     android:text="@string/quadEquForm" 
     android:textSize="18sp" /> 

</RelativeLayout> 
+1

你能發佈你的佈局xml文件嗎? – Yjay

+0

@Yjay後編輯。 – AnDrOiD

回答

0

您需要更改android:layout_heightTextView(所有3個更好)。

<TextView 
    android:id="@+id/stepOne" 
    android:layout_width="wrap_content" 
    android:layout_height="30dp" 
    android:layout_below="@+id/quadEqu" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="25dp" 
    android:text="@string/quadEquForm" 
    android:textSize="18sp" /> 

<TextView 
    android:id="@+id/stepTwo" 
    android:layout_width="wrap_content" 
    android:layout_height="30dp" 
    android:layout_alignLeft="@+id/stepOne" 
    android:layout_below="@+id/stepOne" 
    android:text="@string/quadEquForm" 
    android:textSize="18sp" /> 

<TextView 
    android:id="@+id/stepThree" 
    android:layout_width="wrap_content" 
    android:layout_height="30dp" 
    android:layout_alignLeft="@+id/stepOne" 
    android:layout_below="@+id/stepTwo" 
    android:text="@string/quadEquForm" 
    android:textSize="18sp" /> 
0

這是一個奇怪的行爲。

嘗試將'stepTwo'的內容設置爲'stepThree'。 如果出現同樣的問題,那麼TextView的問題就來了。

您應該檢查是否以編程方式修改'stepThree'textView的填充。

+0

「內容」是什麼意思? 而就像我說的:「我沒有觸及java的風格」... – AnDrOiD

+0

我的意思是textView裏面的文本。 –

+0

當我改變文字看起來很好... – AnDrOiD