I am attempting to show both a title, using setTitle and a custom view in my toolbar.

I am not treating it as an actionbar, instead as nothing more than a view.

I am adding both the titles and custom view in Java

```
 toolbar = (Toolbar) view.findViewById(R.id.toolbar);

    if (title != null) {
        toolbar.setTitle(title);
        toolbar.setTitleTextColor(getResources().getColor(android.R.color.white));
    }

    if (subtitle != null) {
        toolbar.setSubtitle(subtitle);
        toolbar.setSubtitleTextColor(getResources().getColor(android.R.color.white));
    }

    // Add switch view to toolbar
    View switchView = LayoutInflater.from(getActivity())
            .inflate(R.layout.device_list_switch, null);
    toolbar.addView(switchView);

```

The xml for my switch view is

```
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/holo_blue_bright">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/discoverable"
    android:layout_alignParentBottom="true"
    android:layout_alignTop="@+id/discoverable"
    android:layout_toLeftOf="@+id/discoverable"
    android:layout_toStartOf="@+id/discoverable"
    android:gravity="center"
    android:text="@string/discoverable_switch_label"
    android:textColor="@android:color/white"
    />

<Switch
    android:id="@+id/discoverable"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentEnd="true"
    android:layout_alignParentRight="true"
    android:layout_marginLeft="@dimen/discoverable_switch_margin_left"
    android:layout_marginStart="@dimen/discoverable_switch_margin_left"/>

</RelativeLayout>

```

What happens is that the RelativeLayout fills the entire toolbar area and the title isn't visible.

Any ideas?