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 :

Comment fixer la largeur d'un tableau


Sujet :

Android

  1. #1
    Membre confirmé
    Profil pro
    Hhh
    Inscrit en
    Septembre 2007
    Messages
    62
    Détails du profil
    Informations personnelles :
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Hhh

    Informations forums :
    Inscription : Septembre 2007
    Messages : 62
    Par défaut Comment fixer la largeur d'un tableau
    hello

    voici mon code xml d'un layout
    mais j'arrive pas a mettre la 2eme colonne à une largeur fixe ....
    qui peut m'aider svp

    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
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/db1_root"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:contentDescription="@string/description_logo"
        android:orientation="vertical"
        tools:ignore="ExtraText,UselessParent" >
        <LinearLayout style="@style/TitleBar">
            <ImageButton
                style="@style/TitleBarAction"
                android:contentDescription="@string/description_home"
                android:onClick="onClickHome"
                android:src="@drawable/title_home" />
            <TextView
                style="@style/TitleBarText"
                android:text="Information Gaz"            
                >
            </TextView>        
                android:onClick="onClickAbout" />
    	</LinearLayout>
    	<LinearLayout
    	    android:orientation="vertical"
    	    android:layout_width="fill_parent"
    	    android:layout_height="0dp"
    	    android:layout_weight="1"
    	    android:padding="6dip">
         >
    	<ScrollView
    	       android:id="@+id/ScrollView01"
    	       android:layout_width="fill_parent"
    	       android:layout_height="fill_parent" >
    	<FrameLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_gravity="fill">
     
    <LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent">    
     
    <TableLayout  
     
        android:layout_width="match_parent"  
        android:layout_height="match_parent"  
        android:shrinkColumns="*"  
        android:stretchColumns="0,1"
        android:background="#ffffff">  
        <TableRow  
            android:layout_height="fill_parent"  
            android:layout_width="fill_parent"  
            android:gravity="center_horizontal">  
            <TextView  
                android:layout_width="match_parent" android:layout_height="wrap_content" 
                android:textSize="18dp"
                android:text="Compteur Gaz"
                android:layout_span="4"
                android:padding="18dip"
                android:background="#b0b0b0"
                android:textColor="#000"/>  
        </TableRow>  
     
        <TableRow  
            android:id="@+id/tableRow1"  
            android:layout_weight="1"
            android:layout_height="wrap_content"  
            android:layout_width="match_parent">  
            <TextView  
                android:id="@+id/TextView01" 
                android:text="Compteur" 
                android:layout_width="fill_parent"
     
                android:layout_column="0"
                android:layout_weight="1"
                android:layout_span="1"
                android:background="#dcdcdc" 
                android:textColor="#000000"
                android:padding="20dip" 
                android:gravity="center"/>  
            <TextView  
                android:id="@+id/TextView02" 
                android:text="Débit" 
                android:layout_width="fill_parent"
                android:layout_weight="1"
                android:layout_column="1"
                android:layout_span="1"
                android:background="#a09f9f" 
                android:textColor="#000000"
                android:padding="20dip" 
                android:gravity="center"/>  
            <TextView  
                android:id="@+id/TextView03" 
                android:text="Compteur" 
                android:background="#dcdcdc" 
                android:textColor="#000000"
                android:padding="20dip" 
                android:gravity="center"/>  
            <TextView  
                android:id="@+id/TextView04" 
                android:text="Dénomination" 
                android:layout_weight="1"
                android:layout_column="3"
                android:layout_span="1"
                android:background="#a09f9f" 
                android:textColor="#000000"
                android:padding="20dip" 
                android:gravity="center"/>  
            </TableRow> 
    	</TableLayout>
    	</LinearLayout>
     
    	</FrameLayout>
        </ScrollView>
    </LinearLayout>
    </LinearLayout>

  2. #2
    Membre extrêmement actif
    Profil pro
    Développeur
    Inscrit en
    Mars 2012
    Messages
    1 970
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations professionnelles :
    Activité : Développeur
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Mars 2012
    Messages : 1 970
    Par défaut
    essaye avec

Discussions similaires

  1. [HTML] comment fixer la largeur d'une page
    Par ouadie99 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 3
    Dernier message: 19/03/2009, 21h50
  2. [PHP&HTML] Fixer la largeur d'un tableau
    Par Xo Sonic oX dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 01/09/2006, 13h15
  3. Réponses: 3
    Dernier message: 24/08/2006, 10h57
  4. Comment fixer les largeurs des colonnes d'un TStrinGrid
    Par marsupilami34 dans le forum Composants VCL
    Réponses: 6
    Dernier message: 24/08/2005, 13h24

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