Unable to hide TitleBar, becomes transparent
<p>I want to delete the title bar from my app, but when use the following code, the title bar isn't hidden, in fact it becomes transparent and the content is pushed downwards:</p>

<pre><code>@Override
    public void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
</code></pre>

<p>So, I have a gap where the title bar used to be (between the notification bar and the app).
I have searched everywhere but haven't found something similar.</p>

<p><strong>Edit:</strong></p>

<p>I have tried both of the solutions given by seretum and harism (shown below) but I'm still unable to find the problem, this is a part of my xml code:</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#fff"&gt;
    &lt;ImageView android:id="@+id/title"
        android:src="@drawable/main"
        android:layout_width="480dp"
        android:layout_height="155dp"
        android:layout_centerHorizontal="true"
        android:layout_alignParentTop="true"
        android:adjustViewBounds="true"/&gt;
</code></pre>

<p>Somehow, the ImageView isn't aligned to the Top of the relative layout...</p>

<p><strong>Last Edit. SOLUTION:</strong></p>

<p>So, I tinkered with the xml and found out that when you set a custom dimension to a widget and so use the Realtuve Layout; no matter if the Title bar is present or not, the Widget will always be under it. So, here is the solution (you need to put the object in a layout):</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#fff"&gt;
&lt;LinearLayout android:id="@+id/title"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:maxHeight="155dp"
android:maxWidth="480dp"
android:layout_height="wrap_content"&gt;
&lt;ImageView android:src="@drawable/main"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:adjustViewBounds="true"/&gt;
</code></pre>
