2

I've tried a bunch of different permutations setting padding, height, etc, and different layout attributes, but still can't figure out why the Android title bar covers the first View item (EditText).

The layout xml looks like this:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#0099cc"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".Blotter" >

    <EditText
        android:id="@+id/order_entry"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/dummy_order"
        android:keepScreenOn="true"
        android:singleLine="true"
        android:textAlignment="center"
        android:textColor="#33b5e5"
        android:textSize="26sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/status"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:keepScreenOn="true"
        android:text="@string/dummy_content"
        android:textAlignment="center"
        android:textColor="#33b5e5"
        android:textSize="24sp"
        android:textStyle="bold" />

    <GridView
        android:id="@+id/orders"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/status"
        android:layout_alignParentLeft="true"
        android:layout_below="@id/order_entry" />

</RelativeLayout>

And the result in the emulator looks like this:

Android screen shot It's a little hard to see, but I circled the EditText view which the title overlaps. The rendering in the Eclipse ADT Graphical Layout view looks fine, though.

Sam Goldberg
  • 6,711
  • 8
  • 52
  • 85
  • Are you using an action bar library such as ActionBarSherlock? Are you using fragments? or using http://developer.android.com/reference/android/view/Window.html#FEATURE_ACTION_BAR_OVERLAY ? Post the code on how you are using that layout. Meanwhile, here's another question that might be related to your problem: http://stackoverflow.com/questions/19635440/custom-layout-with-actionbar-in-appcompat-causes-content-to-overlap-with-action – frozenkoi Nov 11 '13 at 21:39
  • @frozenkoi: this was just a basic, starter project. No ActionBar, and generally taking the default settings when creating Eclipse Android project. I'll post the code shortly (but there's pretty much nothing to see). Somehow just the default Xml settings doesn't prevent the title from overlapping first View item. – Sam Goldberg Nov 12 '13 at 16:04

1 Answers1

0

Have you try to use requestWindowFeature(Window.FEATURE_NO_TITLE); yet? It's will be called in onCreated in your Activity like this:

    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_main);
justHooman
  • 3,044
  • 2
  • 17
  • 15