IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Composants graphiques Android Discussion :

Superposer deux layouts


Sujet :

Composants graphiques Android

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Mars 2011
    Messages
    140
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 140
    Par défaut Superposer deux layouts
    Bonjour à tous.

    je veux superposer deux layout,

    càd:

    j'ai un linearLayout qui contient un scroll View, je veux placer sur ce scrollView un ImageView,de façon que le scrollView est en arrière plan,

    pour être plus claire ,meme lorsque je deplace mon doigt pour balayer mon scrollView,l'image reste toujours statique et placer en bas de l'ecran.

    voilà mon code xml:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
     <LinearLayout 
        android:orientation="vertical"
    	    android:layout_width="1200px"
    	    android:layout_height="wrap_content" 
     
        >
        <ScrollView  
     android:layout_width="1200px" android:id="@+id/scrollView"
            android:layout_height="wrap_content" >
    <LinearLayout
     
    android:id="@+id/LinearLayout1"
     
        android:background="@drawable/bib7" 
        android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical">
     
     
     
     
     
            <LinearLayout
            android:paddingTop="15dp"
         android:id="@+id/LinearLayout01" android:orientation="horizontal"
         android:layout_height="fill_parent" android:layout_width="fill_parent" >
     
     
     
    </LinearLayout>
     
    <LinearLayout 
     android:paddingTop="70dp"
         android:id="@+id/LinearLayout02" android:orientation="horizontal"
         android:layout_height="fill_parent" android:layout_width="fill_parent" >
     
     
     
    </LinearLayout>
    <LinearLayout 
     android:paddingTop="75dp"
         android:id="@+id/LinearLayout03" android:orientation="horizontal"
         android:layout_height="fill_parent" android:layout_width="fill_parent" >
     
     
     
    </LinearLayout>
    <LinearLayout 
     android:paddingTop="75dp"
         android:id="@+id/LinearLayout04" android:orientation="horizontal"
         android:layout_height="fill_parent" android:layout_width="fill_parent" >
     
     
     
    </LinearLayout>
     
    <LinearLayout 
     android:paddingTop="75dp"
         android:id="@+id/LinearLayout05" android:orientation="horizontal"
         android:layout_height="fill_parent" android:layout_width="fill_parent" >
     
     
     
    </LinearLayout>
    <LinearLayout 
     android:paddingTop="75dp"
         android:id="@+id/LinearLayout06" android:orientation="horizontal"
         android:layout_height="fill_parent" android:layout_width="fill_parent" >
     
     
     
    </LinearLayout>
     
    </LinearLayout>
     
    </ScrollView>
     
    </LinearLayout>
    merci de m'aider

  2. #2
    Membre émérite
    Profil pro
    Inscrit en
    Janvier 2011
    Messages
    757
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2011
    Messages : 757
    Par défaut
    Tu peux utiliser le layout RelativeLayout pour cela

  3. #3
    Membre confirmé
    Inscrit en
    Mars 2011
    Messages
    140
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 140
    Par défaut
    comment ça? as tu un exemple ?

  4. #4
    Expert confirmé

    Avatar de Feanorin
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    4 589
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 4 589
    Par défaut
    Bonjour,

    Le relative Layout n'est pas séquentiel et te permet de superposer tes layouts à toi de bien définir la position de tes view

    Tu trouveras un exemple ici :
    http://developer.android.com/resourc...ivelayout.html

    A toi de faire en sorte que tes views se superposent. un exemple

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    <?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">
        <Button
            android:id="@+id/ok"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:text="OK" />
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:text="Cancel" />
    </RelativeLayout>
    Les deux boutons devraient se superposer, puisque elles ont le même alignement

  5. #5
    Membre confirmé
    Inscrit en
    Mars 2011
    Messages
    140
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 140
    Par défaut
    merci bien

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Superposer deux images - CSS
    Par lhpp dans le forum Mise en page CSS
    Réponses: 5
    Dernier message: 21/04/2010, 18h38
  2. Superposer deux images
    Par Grafokoy dans le forum Mise en page CSS
    Réponses: 2
    Dernier message: 02/12/2006, 23h54
  3. [css]superposer deux DIVs / opacity
    Par narkhor dans le forum Mise en page CSS
    Réponses: 1
    Dernier message: 13/03/2006, 02h38
  4. superposer deux images ?
    Par terminoz dans le forum Balisage (X)HTML et validation W3C
    Réponses: 7
    Dernier message: 20/08/2005, 09h04
  5. FOP: Superposer deux <fo:external-graphic>
    Par JeanLeDébutant dans le forum XML/XSL et SOAP
    Réponses: 7
    Dernier message: 14/06/2005, 15h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo