我试图在布局中插入scrollview,但我看到所有黑色,我不明白为什么。我试图插入一个透明的背景,但没有任何改变。你能救我吗?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:orientation="horizontal"
android:weightSum="100" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent">
<LinearLayout
android:id="@+id/Graph10"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="15"
android:orientation="vertical" android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true">
<LinearLayout
android:id="@+id/Graph"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="15"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="@+id/Graph1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="15"
android:orientation="horizontal" >
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/LL2"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="85"
android:orientation="vertical" >
<TextView
android:id="@+id/tvBluetooth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="Bluetooth"
android:textSize="15dp"
android:textColor="@color/white"/>
<Button
android:id="@+id/bConnect"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:text="Connect"
android:textSize="10dp"
android:textColor="@color/white"/>
<Button
android:id="@+id/bDisconnect"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:text="Disconnect"
android:textSize="10dp"
android:textColor="@color/white"/>
<TextView
android:id="@+id/tvControl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="Control"
android:textSize="15dp"
android:textColor="@color/white" />
<ToggleButton
android:id="@+id/tbStream"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:checked="false"
android:textOff="Start Stream"
android:textOn="Start Stream"
android:textColor="@color/white"/>
<ToggleButton
android:id="@+id/tbScroll"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:checked="true"
android:textOff="Auto Scroll X"
android:textOn="Auto Scroll X"
android:textColor="@color/white"
android:visibility="gone"/>
<LinearLayout
android:id="@+id/LLX"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="100" >
<Button
android:id="@+id/bXminus"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_weight="50"
android:text="-"
android:textSize="12dp"
android:textColor="@color/white"/>
<Button
android:id="@+id/bXplus"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_weight="50"
android:text="+"
android:textSize="12dp"
android:textColor="@color/white"/>
</LinearLayout>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</LinearLayout>
如果我删除ScrollView,一切都很完美。
修改
//init graphview
GraphView = (LinearLayout) findViewById(R.id.Graph);
// init example series data-------------------
Series = new GraphViewSeries("CH1",
new GraphViewSeriesStyle(Color.WHITE, 14),//color and thickness of the line
new GraphViewData[] {new GraphViewData(0, 0)});
graphView = new LineGraphView(
this // context
, "EMG" // heading
);