Layout problem

C

Chris92

Fortgeschrittenes Mitglied
0
Hey ich hab ein Problem

Und zwar krieg ich die Buttons irgendwie nicht nach unten :( kann mir da jemend helfen bitte?

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

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal" >
    
    
   
        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="640dp"
            android:layout_height="650dp" />

        <EditText
            android:id="@+id/edttext"
            android:layout_width="640dp"
            android:layout_height="650dp"
            android:autoText="true"
            android:ems="10"
            android:focusable="false"
            android:gravity="center"
            android:singleLine="false" >

        
        </EditText>
      
    </LinearLayout>  
     <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@android:drawable/bottom_bar"
            android:gravity="center_vertical" >

            <Button
                android:id="@+id/btnCorrectorizer"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Correctorizer" />
 
            <Button
                android:id="@+id/btnOriginalText"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Original Text" />

            <Button
                android:id="@+id/btnPicture"
                 android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Take Picture" />
            
            <Button
                android:id="@+id/btnCorrectedText"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Corrected Text" />

            <Button
                android:id="@+id/btnAbout"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="About" />
          
        </LinearLayout>
    



</FrameLayout>
Das ist der xml code

MFG

chris92
 
Was willst du mit dem FrameLayout ereichen?
FrameLayout

FrameLayout is designed to display a single item at a time. You can have multiple elements within a FrameLayout but each element will be positioned based on the top left of the screen. Elements that overlap will be displayed overlapping. I have created a simple XML layout using FrameLayout that shows how this works.
Probiers damit:
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="horizontal" >
        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="640dp"
            android:layout_height="650dp" />
        <EditText
            android:id="@+id/edttext"
            android:layout_width="640dp"
            android:layout_height="650dp"
            android:autoText="true"
            android:ems="10"
            android:focusable="false"
            android:gravity="center"
            android:singleLine="false" >
        </EditText>
         <Button
             android:id="@+id/btnCorrectorizer"
             android:layout_width="256dp"
             android:layout_height="wrap_content"
              android:text="Correctorizer" />
         <Button
             android:id="@+id/btnOriginalText"
             android:layout_width="256dp"
             android:layout_height="wrap_content"
             android:text="Original Text" />
         <Button
             android:id="@+id/btnPicture"
                 android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Take Picture" />
            <Button
                android:id="@+id/btnCorrectedText"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Corrected Text" />
            <Button
                android:id="@+id/btnAbout"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="About" />
        </LinearLayout>
Wenn du Mehrere in einer Zeilen brauchst, dann nimm Tablerow.
 
Hab dies gerade probiert, jedoch ohne Erfolf :(
Jetzt werden die Buttons garnicht mehr angezeigt.
 
Deine Elemente editText1und imageView1 sind schlichtweg zu groß??
orientation?
HTML:
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
        <EditText
            android:id="@+id/editText1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ems="10" >
            <requestFocus />
        </EditText>
        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="640dp"
            android:layout_height="wrap_content" />
        <EditText
            android:id="@+id/edttext"
            android:layout_width="640dp"
            android:layout_height="wrap_content"
            android:autoText="true"
            android:ems="10"
            android:focusable="false"
            android:gravity="center"
            android:singleLine="false" >
        </EditText>
         <Button
             android:id="@+id/btnCorrectorizer"
             android:layout_width="256dp"
             android:layout_height="wrap_content"
              android:text="Correctorizer" />
         <Button
             android:id="@+id/btnOriginalText"
             android:layout_width="256dp"
             android:layout_height="wrap_content"
             android:text="Original Text" />
         <Button
             android:id="@+id/btnPicture"
                 android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Take Picture" />
            <Button
                android:id="@+id/btnCorrectedText"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Corrected Text" />
            <Button
                android:id="@+id/btnAbout"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="About" />
    </LinearLayout>
 
Also hab dies jetzt auch probiert jedoch ebenfalls ohne erfolg, die buttons sind jetzt untereinandern und die listview und edittext übereinander.

Am liebsten würde ich das layout genau so lassen wie am Anfang nur dass die Buttons unten sind.
 
Mein Vorschlag währe RelativeLayout. Da gibt es die Eigenschaften :

android:layout_below="@id/xyz"
android:layout_toRightOf="@id/xyz"
android:layout_alignParentBottom="true"

Schau dir das zumindest mal an.
 
Nochmal meine Frage:
Was möchtest du mit Frame reichen?

Ich glaube du musst dich bei Layouts und Parameter noch einlesen, (oder durch experimentieren/rumprobieren lernen.)
 
Genau mit dem Relativelayout hab ich es jetzt auch hinbekommen :)

Fertige Version ;)

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

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal" >
    
    
   
        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="640dp"
            android:layout_height="650dp" />

        <EditText
            android:id="@+id/edttext"
            android:layout_width="640dp"
            android:layout_height="650dp"
            android:autoText="true"
            android:ems="10"
            android:focusable="false"
            android:gravity="center"
            android:singleLine="false" >

        
        </EditText>
      
    </LinearLayout>  
     <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@android:drawable/bottom_bar"
            android:gravity="center_vertical" 
            android:layout_alignParentBottom="true"         
            android:layout_alignParentLeft="true">

            <Button
                android:id="@+id/btnCorrectorizer"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Correctorizer" />
 
            <Button
                android:id="@+id/btnOriginalText"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Original Text" />

            <Button
                android:id="@+id/btnPicture"
                 android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Take Picture" />
            
            <Button
                android:id="@+id/btnCorrectedText"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="Corrected Text" />

            <Button
                android:id="@+id/btnAbout"
                android:layout_width="256dp"
                android:layout_height="wrap_content"
                android:text="About" />
          
        </LinearLayout>
    


</RelativeLayout>

Vielen Dank für eure schnelle und freundliche Hilfe.

MFG

Chris92
 

Ähnliche Themen

L
Antworten
4
Aufrufe
1.316
lonnie9020
L
W
  • WuDiDong
Antworten
3
Aufrufe
755
jogimuc
J
A
Antworten
1
Aufrufe
865
koje71
koje71
Zurück
Oben Unten