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 :

Créer écran d'accueil avec images and texte centralisés


Sujet :

Android

  1. #1
    Nouveau membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Décembre 2013
    Messages
    49
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : Associations - ONG

    Informations forums :
    Inscription : Décembre 2013
    Messages : 49
    Points : 39
    Points
    39
    Par défaut Créer écran d'accueil avec images and texte centralisés
    Bonjour,

    Dans mon application (téléphone et tablette) je voudrais que l'écran d'accueil soit composée d'une étiquette avec du texte, de 4 images (chacune avec du texte en dessous) and du nom de la application, quelque chose comme l'image jointe.

    J'ai fait plusieurs essais avec les différents layouts, mais je ne parviens pas a mon but

    Mon xml est maintenant celui-ci, j'ai commencé faire des preuves avec 2 images... elles sont l'une à coté de l'autre, ici le texte est en dessus, car je n'arrive pas le mettre en dessous. En plus, avec ce code, lorsque je tourne l'écran, les images et le texte ne se montrent pas centrés.

    Je vous remercie si vous pouvez m'orienter sur les différents éléments nécessaires pour parvenir a mon but, afin d'avoir un xml dans lequel le contenu se montre centré soit dans un téléphone, soit dans une tablette.
    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
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#0099cc"
        tools:context="org.deiverbum.liturgiacatolica.FullscreenActivity">
     
        <!-- The primary full-screen view. This can be replaced with whatever view
             is needed to present your content, e.g. VideoView, SurfaceView,
             TextureView, etc. -->
     
        <TextView
            android:id="@+id/fullscreen_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:keepScreenOn="true"
            android:text="@string/dummy_content"
            android:textColor="#33b5e5"
            android:textSize="50sp"
            android:textStyle="bold" />
     
        <!-- This FrameLayout insets its children based on system windows using
             android:fitsSystemWindows. -->
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true">
     
            <LinearLayout
                android:id="@+id/fullscreen_content_controls"
                style="?metaButtonBarStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom|center_horizontal"
                android:background="@color/black_overlay"
                android:orientation="horizontal"
                tools:ignore="UselessParent">
            </LinearLayout>
     
     
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent" >
     <!--           android:background="@drawable/red_android_background"-->
     
     
                <RelativeLayout
                    android:layout_width="213dp"
                    android:layout_height="33dp">
     
                    <TextView
                        android:id="@+id/textLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Misa"
                        android:textSize="18sp"
                        android:textStyle="bold"
                        android:layout_weight="2.08"
                        android:layout_centerHorizontal="true" />
                </RelativeLayout>
                <RelativeLayout
                    android:layout_width="213dp"
                    android:layout_height="33dp"
                    android:layout_alignParentRight="true"
                    android:layout_alignParentEnd="true">
     
                    <TextView
                        android:id="@+id/labelBreviario"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Breviario"
                        android:textSize="18sp"
                        android:textStyle="bold"
                        android:layout_weight="2.08"
                        android:layout_alignParentTop="true"
                        android:layout_centerHorizontal="true" />
                </RelativeLayout>
     
                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:weightSum="1"
                    android:layout_marginTop="18dp"
                    android:layout_alignParentTop="true"
                    android:layout_centerHorizontal="true">
     
                    <ImageView
                        android:layout_width="120dp"
                        android:layout_height="115dp"
                        app:srcCompat="@drawable/ic_store_black_48dp"
                        android:id="@+id/imageMisa"
                        android:layout_marginRight="50dp" />
     
                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        app:srcCompat="@drawable/ic_import_contacts_black_48dp"
                        android:id="@+id/image_breviario"
                        android:gravity="center"
                        android:clickable="true" />
                </LinearLayout>
            </RelativeLayout>
     
        </FrameLayout>
     
    </FrameLayout>
    Images attachées Images attachées  

Discussions similaires

  1. [WPF+C#.NET] Combobox avec image et texte
    Par Siphon dans le forum Windows Presentation Foundation
    Réponses: 0
    Dernier message: 25/02/2011, 14h37
  2. Créer un fichier word avec image et texte dedans
    Par nocolach dans le forum MATLAB
    Réponses: 3
    Dernier message: 02/07/2008, 00h19
  3. imprimer une facture avec image et texte
    Par mouss4rs dans le forum AWT/Swing
    Réponses: 4
    Dernier message: 23/04/2008, 08h25
  4. fond d'ecran avec image et texte
    Par sophe dans le forum Balisage (X)HTML et validation W3C
    Réponses: 5
    Dernier message: 12/02/2007, 01h01
  5. Pb lien avec image et texte dans un li
    Par lalouve dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 09/03/2006, 01h33

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