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 :

Design onglets tabhost


Sujet :

Android

  1. #1
    Membre averti
    Inscrit en
    Juin 2003
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Juin 2003
    Messages : 32
    Par défaut Design onglets tabhost
    Bonjour,

    mon problème est purement esthétique, quand je crée mes onglets, ils sont rectangulaires alors que je vois de très jolis onglets arrondis: comment réussir à créer ces onglets à bords arrondis?

    D'avance merci!

  2. #2
    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,

    Je ne sais pas si cela peut t'aider mais regarde tu côté des tabwidget
    http://developer.android.com/referen...TabWidget.html

    Je ne connais pas tout les procédures mais par exemple setDividerDrawable a l'air intéressante .

    Sinon je pense que tu peux toujours touché à l'inflater de la tabwidget et le modifier directement .

  3. #3
    Membre averti
    Inscrit en
    Juin 2003
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Juin 2003
    Messages : 32
    Par défaut
    Merci de ta réponse, je n'ai pas trouvé mon bonheur... et je ne comprends pas comment modifier l'inflater de la tabwidget (je débute...)
    Je te remercie de ton aide!
    ps: J'ai été sur http://developer.android.com/resourc...tabwidget.html et le résultat est exactement ce que j'attends et visiblement ils ne modifient rien de particulier! je comprends pas:

  4. #4
    Membre averti
    Inscrit en
    Juin 2003
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Juin 2003
    Messages : 32
    Par défaut
    pour vous donner la preuve en image:
    Nom : vu.JPG
Affichages : 105
Taille : 10,3 Ko
    au lieu de :

  5. #5
    Rédacteur
    Avatar de MrDuChnok
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2002
    Messages
    2 112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juin 2002
    Messages : 2 112
    Par défaut
    Salut,

    Je vais peut être dire des bétises, mais je crois que le composant pour gérer les tabs a été retravailler à partir de la version 2.0 (ou 2.1 ou 2.2 ^^) d'Android.
    Du coup, en fonction de ta cible, tu n'auras peut être pas le même visuel.
    Pourrais-tu préciser la version du SDK que tu utilises ?

    Merci

  6. #6
    Membre averti
    Inscrit en
    Juin 2003
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Juin 2003
    Messages : 32
    Par défaut
    Bonjour,
    je ne crois pas que cela vienne de là, j'ai le sdk pour la version 2.2... une autre idée?

  7. #7
    Rédacteur
    Avatar de MrDuChnok
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2002
    Messages
    2 112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juin 2002
    Messages : 2 112
    Par défaut
    Salut,

    Peux tu poster ton layout XML ?
    Merci.

  8. #8
    Membre averti
    Inscrit en
    Juin 2003
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Juin 2003
    Messages : 32
    Par défaut
    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
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    <?xml version="1.0" encoding="utf-8"?>
    <TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    	android:id="@android:id/tabhost" android:layout_width="fill_parent"
    	android:layout_height="fill_parent"
    	>
     
    	<LinearLayout android:orientation="vertical"
    		android:layout_width="fill_parent"
    		android:layout_height="fill_parent"
    		>
     
    		<TabWidget android:id="@android:id/tabs"
    			android:layout_width="fill_parent"
    			android:layout_height="wrap_content"
     
    			 />
     
    		<FrameLayout android:id="@android:id/tabcontent"
    			android:layout_width="fill_parent"
    			android:layout_height="fill_parent"
     
    			>
     
    			<LinearLayout android:id="@+id/tab1"
    				android:layout_width="fill_parent"
    				android:layout_height="fill_parent"
    				android:orientation="vertical"
    				android:padding="5dp"
     
     
    				>
     
    				<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/mojito"
        android:padding="5dp"
        >
     
     
    	<TextView
    android:id="@+id/Text01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Trouver Le Bon Mojito"
    android:textStyle="bold"
    android:textSize="18px"
    />
    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="2dip"
    android:background="#666666" 
    />
     
    <TextView
    android:id="@+id/Text02"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="www.lebonmojito.com"
    android:textSize="12px"
    />
     
    <TextView
    android:id="@+id/Text03"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text=" "
    android:textSize="10px"
    />
     
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:gravity="center_horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        >
     
    <Button android:id="@+id/button1"
    android:text="Par géolocalisation"
    android:layout_width="170px"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:drawableLeft="@drawable/globe36"
    />
     
    <Button android:id="@+id/button2"
    android:text="Par adresse"
    android:layout_width="170px"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:drawableLeft="@drawable/car36"
    />
     
    <Button android:id="@+id/button3"
    android:text="Paramètres"
    android:layout_width="170px"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:drawableLeft="@drawable/equalizer36"
    />
     
    </LinearLayout>
    <TextView android:layout_width="wrap_content"
    		android:layout_height="wrap_content" 
    		android:id="@+id/adresse"
    		android:layout_below="@+id/LinearLayout01"
    		android:layout_centerHorizontal="true" 
    		android:layout_marginTop="10dip" />
     
     
    </LinearLayout>
    			</LinearLayout>
     
    					<LinearLayout android:id="@+id/tab2"
    				android:orientation="horizontal"
    				android:layout_width="fill_parent"
    				android:layout_height="fill_parent" >
    					<EditText android:id="@+id/EditText03" 
    						android:text="valeur 3"
    						android:layout_width="wrap_content"
    						android:layout_height="wrap_content" />
    			</LinearLayout>
    			<LinearLayout android:id="@+id/tab3"
    				android:orientation="horizontal"
    				android:layout_width="fill_parent"
    				android:layout_height="fill_parent" >
    					<EditText android:id="@+id/EditText03" 
    						android:text="valeur 3"
    						android:layout_width="wrap_content"
    						android:layout_height="wrap_content" />
    			</LinearLayout>
     
     
     
    		</FrameLayout>
    	</LinearLayout>
    </TabHost>

    merci de ton aide!

Discussions similaires

  1. Navigation entre les onglets (TabHost)
    Par JQueen dans le forum Composants graphiques
    Réponses: 14
    Dernier message: 15/10/2012, 14h51
  2. Espace entre onglet tabhost
    Par xouzi dans le forum Android
    Réponses: 1
    Dernier message: 20/02/2012, 14h44
  3. Problème affichage dans des onglets tabHost
    Par flavdu44 dans le forum Android
    Réponses: 3
    Dernier message: 24/11/2011, 17h36
  4. [VS2008] Onglet design inactif sur projet Silverlight
    Par vanquish dans le forum Visual Studio
    Réponses: 2
    Dernier message: 07/07/2009, 11h42
  5. Onglet Form1.cs [Design] disparu
    Par jlouis_34 dans le forum Windows Forms
    Réponses: 4
    Dernier message: 08/01/2008, 13h54

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