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

Android Discussion :

RelativeLayout: Problème placement circulaire


Sujet :

Android

  1. #1
    Membre régulier
    Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Décembre 2006
    Messages
    156
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Décembre 2006
    Messages : 156
    Points : 110
    Points
    110
    Par défaut RelativeLayout: Problème placement circulaire
    Bonjour à tous,

    je cherche à placer 9 images équidistantes en forme de cercle grâce à un relativelayout comparé à un centre.

    J'ai presque réussi mais les 2 dernières images ne peuvent pas être placée correctement (cf. image avec l'avant dernière)

    Ci-dessous, le 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
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
     
    <?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"
        android:layout_gravity="center"
        android:orientation="vertical" >
     
        <ImageView
            android:id="@+id/center"
            android:layout_width="0dp" 
            android:layout_height="0dp"
            android:layout_centerInParent="true"
            android:background="#FFFF0000"
        />
     
        <ImageView
            android:id="@+id/center_top_a_1"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_above="@id/center"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="50dp"
            android:background="#FF00FF00" />
     
        <ImageView 
            android:id="@+id/bottom_left_a_1"
            android:layout_width="40dp" 
            android:layout_height="40dp"
            android:background="#FF00FF00"
            android:layout_below="@id/center"
            android:layout_toLeftOf="@id/center"
            android:layout_marginRight="40dp"
            android:layout_marginTop="50dp"
        />
     
        <ImageView 
            android:id="@+id/bottom_right_a_1"
            android:layout_width="40dp" 
            android:layout_height="40dp"
            android:background="#FF00FF00"
            android:layout_below="@id/center"
            android:layout_toRightOf="@id/center"
            android:layout_marginLeft="60dp"
            android:layout_marginTop="50dp"
        />
     
     <ImageView
            android:id="@+id/center_top_b_1"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_toLeftOf="@id/center"
            android:layout_above="@id/center"
            android:layout_marginBottom="20dp"
            android:layout_marginRight="40dp"
            android:background="#FF00FF00" />
     
     <ImageView
            android:id="@+id/center_top_c_1"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_above="@id/center"
            android:layout_toRightOf="@id/center"
            android:layout_marginBottom="20dp"
            android:layout_marginLeft="40dp"
            android:background="#FF00FF00" />
     
     <ImageView
            android:id="@+id/center_left_b_1"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_toLeftOf="@id/center"
            android:layout_below="@id/center"
            android:layout_marginBottom="1dp"
            android:layout_marginRight="50dp"
            android:background="#FF00FF00" />
     <ImageView
            android:id="@+id/center_right_b_1"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_toRightOf="@id/center"
            android:layout_below="@id/center"
            android:layout_marginBottom="1dp"
            android:layout_marginLeft="50dp"
            android:background="#FF00FF00" />
     
          <ImageView
              android:id="@+id/center_right_c_1"
              android:layout_width="40dp"
              android:layout_height="40dp"
              android:layout_below="@+id/center"
              android:layout_marginBottom="60dp"
              android:layout_marginLeft="2dp"
              android:layout_toRightOf="@+id/center"
              android:background="#FF00FF00" />
     
    </RelativeLayout>
    Quelqu'un sait comment corriger ça?

    Merci d'avance,

    Nicolas
    Images attachées Images attachées  

  2. #2
    Membre régulier
    Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Décembre 2006
    Messages
    156
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Décembre 2006
    Messages : 156
    Points : 110
    Points
    110
    Par défaut
    fausse alerte: erreur trouvée

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

Discussions similaires

  1. Problème Référence circulaire
    Par helico2 dans le forum C++/CLI
    Réponses: 0
    Dernier message: 28/05/2008, 23h36
  2. Problème placement superposé h1 en z-index
    Par La Fée dans le forum Mise en page CSS
    Réponses: 1
    Dernier message: 03/04/2008, 20h29
  3. Problème référence circulaire
    Par Golgotha dans le forum Langage
    Réponses: 3
    Dernier message: 28/03/2008, 01h20
  4. Problème Référence Circulaire
    Par lfournial dans le forum Spring
    Réponses: 2
    Dernier message: 16/11/2007, 17h39
  5. Problème : placement d'icone
    Par tigr0u dans le forum Balisage (X)HTML et validation W3C
    Réponses: 7
    Dernier message: 25/09/2006, 17h01

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