當滾動視圖作爲根標記包含在內時,不會顯示將屏幕精確分割爲兩個的行分隔符。否則,它的工作正常。線路分隔符不工作滾動視圖Android
這是我的佈局文件。
<ScrollView 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">
<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"
tools:context=".MainActivity">
<LinearLayout
android:id="@+id/firstLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="@+id/secondView"
android:orientation="vertical"
android:paddingLeft="8dp">
<TextView
android:id="@+id/Goals"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginTop="15dp"
android:fontFamily="sans-serif-smallcaps"
android:text="Goals Scored- MANU"
android:textSize="18sp" />
<Button
android:id="@+id/AddButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:text="+" />
<Button
android:id="@+id/SubButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:text="-" />
<TextView
android:id="@+id/Fouls"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:fontFamily="sans-serif-smallcaps"
android:text="Fouls"
android:textSize="18sp" />
<Button
android:id="@+id/AddButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:text="+" />
<Button
android:id="@+id/SubButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-" />
<TextView
android:id="@+id/goalsscoredteamone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textStyle="bold" />
<TextView
android:id="@+id/foulsmadeteamone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textStyle="bold" />
</LinearLayout>
<View
android:id="@+id/secondView"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:background="#000000" />
<LinearLayout
android:id="@+id/thirdLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/secondView"
android:orientation="vertical"
android:paddingLeft="8dp">
<TextView
android:id="@+id/Goalsteam2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginTop="15dp"
android:fontFamily="sans-serif-smallcaps"
android:text="Goals Scored MANC"
android:textSize="18sp" />
<Button
android:id="@+id/AddButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:text="+" />
<Button
android:id="@+id/SubButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:text="-" />
<TextView
android:id="@+id/Foulsteam2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:fontFamily="sans-serif-smallcaps"
android:text="Fouls"
android:textSize="18sp" />
<Button
android:id="@+id/AddButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:text="+" />
<Button
android:id="@+id/SubButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-" />
<TextView
android:id="@+id/goalsscoredteamtwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textStyle="bold" />
<TextView
android:id="@+id/foulsmadeteamtwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
各地需要的任何工作或任何可能的解決方案?
發表您的完整的XML我們沒有法力這裏 –
我只是問,因爲滾動視圖這背後的邏輯將高度作爲一個變量,而不是固定的高度,這使得故障線路分隔符 –
所以我們需要假設你已經完成了所有的事情並解釋了邏輯......如果你認爲你已經做了正確的事情,爲什麼你要提出問題?再等一個小時,你就不會得到答案,如果你這樣做:D –