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 :

Problème affichage


Sujet :

Android

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2012
    Messages
    128
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Décembre 2012
    Messages : 128
    Par défaut Problème affichage
    Bonjour je reviens vers vous cette fois ci pour un problème d'affichage.
    je voudrais faire un affichage comme cette image a l'exception près que les carré sont des gros boutons.


    http://www.google.fr/imgres?um=1&hl=...r:84,s:0,i:336


    Et je souhaiterais que cela soit adaptable à toute sorte de taille d'écran.
    je n'ai pas trouver j'ai essayer avec un table layout mais le rendu n'est pas terrible, les marge ne sont pas confondues, les bouton sont de forme rectangulaire et non carrée.

    J’espère que vous pourrez m'aider

    Voici mon code
    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
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/scroll"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >
     
        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical" >
     
            <ImageView
                android:id="@+id/picture"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/normal_padding"
                android:src="@drawable/picture2" />
     
            <LinearLayout
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_gravity="center_horizontal"
                android:orientation="vertical" >
     
                <TableLayout
                    xmlns:android="http://schemas.android.com/apk/res/android"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_gravity="center_horizontal"
                    android:orientation="vertical"
                    android:layout_marginTop="300dp" >
     
                    <TableRow
                        android:id="@+id/TableRow1"
                        android:layout_width="wrap_content"
                        android:layout_height="200dp"
                        android:gravity="center_horizontal|center_vertical|clip_horizontal" >
     
                        <Button
                            android:id="@+id/rechercheClient"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/rechercheClient" />
     
                        <Button
                            android:id="@+id/rechercheArticle"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/rechercheArticle" />
                    </TableRow>
     
                    <TableRow android:gravity="center_horizontal|center_vertical|clip_horizontal" >
     
                        <Button
                            android:id="@+id/autre"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="0dp"
                            android:text="...?" />
     
                        <Button
                            android:id="@+id/retour"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/retour" />
                    </TableRow>
                </TableLayout>
            </LinearLayout>
        </LinearLayout>
     
    </ScrollView>
    Cordialement.

  2. #2
    Nouveau candidat au Club
    Profil pro
    Inscrit en
    Avril 2002
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2002
    Messages : 2

  3. #3
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2012
    Messages
    128
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Décembre 2012
    Messages : 128
    Par défaut
    Oui j'y avais bien songer à ce gridView. Cependant moi c'est un tableau de type bouton que je veux et non des images. J'ai essayer d'adapter mais je ne vois ou on peut mettre les boutons.

    Merci d'avance.

  4. #4
    Expert confirmé

    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Février 2007
    Messages
    4 253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Février 2007
    Messages : 4 253
    Billets dans le blog
    3
    Par défaut
    GridView est une grille de "layouts"
    Si ces layouts sont de simples boutons peu importe !


    Activité => Layout avec un GridView
    Initialisation du GridView avec un Adapter (=> Layout GridItem)
    GridItem.xml:

  5. #5
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2012
    Messages
    128
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Décembre 2012
    Messages : 128
    Par défaut
    ok. Mais j'y arrive que avec des images. A partir du moment ou je mets des boutons j'ai plus rien qui s'affiche.

    Si vous aviez un petit bout de code je suis preneur.

    Cordialement

Discussions similaires

  1. Réponses: 10
    Dernier message: 08/06/2009, 11h30
  2. problème affichage image
    Par thealpacino dans le forum Balisage (X)HTML et validation W3C
    Réponses: 8
    Dernier message: 30/05/2005, 13h56
  3. Problème affichage primitive
    Par goutbouyo dans le forum DirectX
    Réponses: 4
    Dernier message: 29/12/2004, 18h25
  4. [Plugin][VE] Problème affichage
    Par sebb84 dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 05/07/2004, 14h50
  5. [DOS] Problème affichage de DOS dans un Memo
    Par Pedro dans le forum API, COM et SDKs
    Réponses: 9
    Dernier message: 25/06/2004, 13h31

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