I am trying to get a ProgressBar and TextView to be centered within a ViewSwitcher. They can be positioned vertically above each other although I have no problem if they were centered horizontally next to each other. I am able to get them to center horizontally but not vertically. It seems that the height of the outer view (the ViewSwitcher) doesn't fill vertically although every parent view has android:layout_height="fill_parent"
Here is the xml:
<ViewSwitcher
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/loadSwitcher"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:background="#ff000000">
<ProgressBar
android:indeterminate="true"
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/marker_progress"
style="?android:attr/progressBarStyle"
android:gravity="center_vertical" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textSize="18sp"
android:text="Loading data..."
android:gravity="center" />
</LinearLayout>
<ListView
android:id="@+id/android:appCategoriesList"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff918e8e"
android:divider="#ff000000"
android:dividerHeight="1dp"
android:cacheColorHint="#00000000"
android:scrollingCache="true"
android:clickable="false"
android:focusable="false" />
</ViewSwitcher>