Your problem is that you set windowActionBarOverlay
to false
.
To have your content below the action bar :
Add this in your style.xml from the values folder :
<item name="windowActionBarOverlay">true</item>
<item name="windowContentOverlay">@null</item>
<item name="android:windowContentOverlay">@null</item>
And this in your style.xml from the values-v14 folder :
<item name="windowActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="windowContentOverlay">@null</item>
Then in your layouts, you can get the size of the action bar with this :
android:layout_marginTop="?attr/actionBarSize"
You need to use the attribute instead of "48dp" or "46dp" because the height changes according to different configuration (portrait/landscape, tablet/phone, ...).
To make the action bar transparent, you need to change the background. Either in your theme or by code.
getActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00000000")));
EDIt : I've just checked in one of my project. Apparently, setting a margin on the root of a layout for an activity doesn't work. So I did something like that :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<View //invisible view, to prevent warning
android:layout_width="fill_parent"
android:layout_height="0dp"
android:visibility="gone" >
</View>
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="?attr/actionBarSize" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
//real content
</LinearLayout>
</ScrollView>