ViewFlipper mit relativer Höhe für SmartPhone o. Tablet

  • 2 Antworten
  • Letztes Antwortdatum
N

Nemolus

Ambitioniertes Mitglied
1
Ich möchte eine View mit einem ViewFlipper erzeugen. Die App soll dann mal auf einem SmartPhone als auch auf einem Tablet laufen können. Am unteren Rand der View sollen 2 Buttons sein, die immer Bottom sind. Ist es möglich die Height vom ViewFlipper relativ zum Screen.Size des Device zu haben?

Hier mein aktuelles Layout:
HTML:
<?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="wrap_content"
    android:background="#f8f9fe"
    android:orientation="vertical">

    <include layout="@layout/actionbar_layout" />
    
    <ViewFlipper
        android:id="@+id/viewFlipper"
        android:layout_width="fill_parent"
        android:layout_height="300dp"
        android:layout_centerInParent="true"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:addStatesFromChildren="true" >
            
        <TextView  
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@drawable/rounded_corners2"
            android:layout_gravity="center"
            android:gravity="center"             
            android:text="MyFlashCardText: Language1"   />
                
        <TextView  
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@drawable/rounded_corners2"
            android:layout_gravity="center"
            android:gravity="center"             
            android:text="MyFlashCardText: Language2"   />

    </ViewFlipper>
    
        
    <LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:layout_marginTop="10dp">
  
        <Button
            android:id="@+id/btnPrevious"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.33"
            android:text="Previous"/>
    
        <Button
            android:id="@+id/btnNext"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.33"
            android:text="Next"/>

    </LinearLayout>
    
</LinearLayout >
 
Mit layout weight ist das möglich

Gesendet von meinem Galaxy Nexus mit der Android-Hilfe.de App
 
  • Danke
Reaktionen: Nemolus
Hab's hin bekommen. Danke
 
Zurück
Oben Unten