2 Layouts in einem

  • 1 Antworten
  • Letztes Antwortdatum
T

tkiela123

Neues Mitglied
1
Moin.

Ich manage in einem FrameLayout ein paar überlappende Bilder. Unter diesem ganzen Layout möchte ich gerne einen Button darstellen.
Ich hab das ganze mit 2 Linearen Layouts in einem versucht, dies hat aber nicht geklappt.

Wie mach ich das am besten, ohne den Button im FrameLayout zu packen und ihne programmatisch zu positionieren?

Hier mein Layoutcode:
Code:
<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<FrameLayout
    android:id="@+id/framelayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="top|left" >
     <ImageView
         android:id="@+id/coverimg"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="top|left"
         android:maxHeight="100dp"
         android:minHeight="130dp"
         android:minWidth="130dp"
         android:src="@drawable/cover_img" />
     <ImageView
         android:id="@+id/imageView2"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
         android:layout_marginLeft="100dp"
         android:src="@android:drawable/ic_media_play" />
<ProgressBar
        android:id="@+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
        android:visibility="gone" />
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:text="Button" />
</LinearLayout>
</LinearLayout>
 
warum brauchst du zwei LinearLayouts? du kannst es doch auch so machen:

LinearLayout (Vertical)
-> Framelayout
-> Button

so ist das Framelayout in einer "Zelle" und der Button in der darumter liegenden "Zelle"
 
Zurück
Oben Unten