我正在尝试将我创建的工具栏放在Android应用程序底部的屏幕上。这是我目前的进展情况:http://imgur.com/n7g4yVk。我想要移动位于屏幕底部中心的黑色条,但是我不知道如何实现。这是我在Android Studio中的XML代码:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<!--Begin Top Bar-->
<Toolbar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lbs"
android:id="@+id/tvLbs"
android:textSize="17dp"
android:textColor="#000000"
android:layout_gravity="left"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/logo"/>
</Toolbar>
<!--End Top Bar-->
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/week1"
/>
<!--Begin all scrollable stuff-->
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/total"
android:textSize="45dp"
android:layout_gravity="center"
android:id="@+id/tvDisplay"
/>
<Button
android:layout_width="250dp"
android:layout_height="wrap_content"
android:text="Add one"
android:layout_gravity="center"
android:textSize="20dp"
android:id="@+id/bAdd"
/>
<Button
android:layout_width="250dp"
android:layout_height="wrap_content"
android:text="Subtract one"
android:layout_gravity="center"
android:textSize="20dp"
android:id="@+id/bSubtract"
/>
</LinearLayout>
</ScrollView>
<!--End Scrollable stuff-->
<Toolbar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#000000"
android:alignParentBottom="true">
</Toolbar>
</LinearLayout>