我试图让SeekBar显示在屏幕底部,但实际上是在我创建的LinerLayout下,但我似乎无法显示它。我把屏幕分成了5个部分,想要在屏幕底部的搜索栏,哪里出错了?
<LinearLayout 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"
android:background="@color/gray"
android:orientation="horizontal"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1.0"
android:background="@color/white" />
<FrameLayout
android:id="@+id/green"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1.0"
android:background="@color/green" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/blue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1.0"
android:background="@color/blue" />
<FrameLayout
android:id="@+id/red"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1.0"
android:background="@color/red" />
<FrameLayout
android:id="@+id/yellow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1.0"
android:background="@color/yellow" />
</LinearLayout>
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="0dp"
android:layout_height="wrap_content" />
</LinearLayout>
尝试将SeekBar布局宽度更改为"match_parent":
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
希望这能有所帮助。
包含的linearlayout的方向="horizontal",请尝试将其设置为"vertical"。