我想我的行動欄的寬度填充所有的屏幕,我遵循此tutorial,但是當我移動寬度參數我不能填充我的屏幕的所有寬度。當我使用默認的actionBar主題時,actionBar覆蓋了屏幕的所有寬度,但是當我自己創建一個actionBar時,我無法做到,無論如何呢?這是它看起來像 編輯1 它的工作原理,問題是填充,所以我把我的兩個RelativeLayout和ActionBar移動到另一個RelativeLayout與這個參數和工作得很好,移動我的ActionBar下面的第二個RelativeLayoutAndroid - 行動的寬度條
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
tools:context="com.marcelo.notemuevas.MainActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:layout_below="@id/my_toolbar">
</RelativeLayout>
</RelativeLayout>
哦!你是正確的!,我更新填充值爲0,它被修復,可以將主動RelativeLayout之外的動作條移動? – Pulse9
是的,雖然操作欄和相關佈局必須位於另一個視圖組內,但這是可能的。調整填充可能是一個更好的選擇。 – jomartigcal