このようなスクロールビューを追加するだけで、画面が読み込まれた後、黒い背景が表示されます。
この黒い領域は、周囲のRelativeLayoutの左上隅に配置されます。スクロールビューがandroid:layout_marginLeft="20dp"
android:layout_marginTop="40dp"
Soで配置されている間、左側の20dpと上部の40dpは黒で、残りの灰色の背景はそのままです。
ここに、scrollViewを含むxml部分があります。
<View
android:id="@+id/emptyView"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="@+id/right1" />
<RelativeLayout
android:id="@+id/right2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/emptyView" >
<RelativeLayout
android:id="@+id/right22"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/emptyView" >
<ImageView
android:id="@+id/emptyView2"
android:layout_width="match_parent"
android:layout_height="2dp"
android:contentDescription="@string/anyStringValue" />
<HorizontalScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="520dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="40dp"
android:background="#0000FF" >
<TextView
android:id="@+id/infoTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#FF0000"
android:padding="10dp"
android:text="@string/Settings_infoTxt"
android:textColor="#000000"
android:textSize="20dp" />
</HorizontalScrollView>
</RelativeLayout>
</RelativeLayout>
スクロールビューの上にemptyViewと2つのRelativeLayoutsを追加しようとしました。しかし、黒い領域は何があっても表示され続けます。(RelativeLayoutsと上部の空のビューがある場合とない場合)
ページ全体の背景が灰色であるため、この黒い領域が画面全体を歪めます。
以前はスクロールビューを何度も使用していましたが、このような問題は発生しませんでした。何が原因なのかわかりません。
スクロールビューによって引き起こされた黒い領域を取り除くにはどうすればよいですか?
どうもありがとう!