EditText über einem Fragment

J

jskeletti

Fortgeschrittenes Mitglied
19
Ich habe ein Problem mit dem Layout, das ich nicht ums verrecken nicht lösen kann. Ich habe eine Activity mit einer Actionbar und darunter Tabs (über die Actionbar). Unter den Tabs (oder darüber, das ist egal) hätte ich gern ein TextView oder Edittext, das beim Umschalten auf andere Tabs eingeblendet bleibt und darunter ist dann ein ListFragment. So sehen meine xml files aus:

main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="top"
    android:orientation="horizontal" >

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/searchbar_view"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="top"
        android:orientation="horizontal"
        android:visibility="visible" >

        <EditText
            android:id="@+id/txtNewItem"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ems="10"
            android:focusableInTouchMode="true"
            android:imeActionId="1337"
            android:imeOptions="actionGo"
            android:inputType="textAutoComplete"
            android:onClick="onClickItemSoftKeyGo"
            android:singleLine="true" >

            <requestFocus />
        </EditText>
    </LinearLayout>

    <fragment
        android:id="@+id/listFragment"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginTop="?android:attr/actionBarSize"
        android:layout_weight="1"
        class="klasse.MainFragment" />

</LinearLayout>

listview.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/android:list"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center" >
    </ListView>

</LinearLayout>

listrow.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <TextView
        android:id="@+id/txtId"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="invisible" />

    <CheckedTextView
        android:id="@+id/cbChecked"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:checkMark="?android:attr/textCheckMark"
        android:checked="true"
        android:gravity="center_vertical"
        android:padding="10dp"
        android:text="@string/hello"
        android:textSize="18dp" />

</RelativeLayout>

Es sind viele möglicherweise unnötigen Elemente drin, da ich die letzten Tage viel experimentiert habe. So möchte ich, dass es mal aussieht:

Code:
---------------------
| Actionbar         |
| Tab1|Tab2|...     |
| Textview          |
| Listitem          |
| Listitem          |
| Listitem          |
| Listitem          |
| Listitem          |
| Listitem          |
...
---------------------

Ich vermute, dass es in der main.xml gemacht wird. Hab aber keinen Plan mehr wie...
 

Ähnliche Themen

S
Antworten
4
Aufrufe
4.476
mblaster4711
mblaster4711
L
Antworten
5
Aufrufe
818
swa00
swa00
A
  • Alex1978
Antworten
4
Aufrufe
820
Alex1978
A
Zurück
Oben Unten