AceHomard Posted November 19, 2015 Share Posted November 19, 2015 Bonjour, je vais essayer de m'expliquer le mieux possible, je travaille sur Android studio et j'aimerais obtenir ceci: Alors j'aimerais que ma barre titre ici en bleu Reste visible quoi qu'il arrive, le soucis c'est que mon drawerlayout lui passe dessus(Pas sur cette photo, car c'est une photo de ce que j'aimerais obtenir et pas de ce que j'obtiens), en rouge il y a la page principale ici sans importance. Voila si quelqu'un aurait une idée de comment procédé pour mettre un Layout en Premier plan sur tout les pages d'une application, merci d'avance. Quote Link to comment Share on other sites More sharing options...
gob0 Posted November 20, 2015 Share Posted November 20, 2015 Salut, plutôt qu'une photo de ce que tu souhaites, est-ce que tu pourrais nous montrer le code XML de ton écran et un screenshot du problème? Quote Link to comment Share on other sites More sharing options...
AceHomard Posted November 21, 2015 Author Share Posted November 21, 2015 Bonjour, Voici mon code XML: Main.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:context=".MainActivityFragment" xmlns:app="http://schemas.android.com/apk/res-auto"> <LinearLayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="32dp" android:background="#0a5772" android:id="@+id/linearLayout"> <ImageButton android:id="@+id/imageButtonContact" android:layout_width="wrap_content" android:layout_height="28dp" android:src="@drawable/icon_contact" android:visibility="visible" android:background="#00000000" android:clickable="true" android:adjustViewBounds="true" android:scaleType="fitCenter" android:layout_weight="1" /> <ImageButton android:id="@+id/imageButtonUser" android:layout_width="wrap_content" android:layout_height="28dp" android:src="@drawable/icon_profil" android:background="#00000000" android:clickable="true" android:adjustViewBounds="true" android:scaleType="fitCenter" android:layout_weight="1" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:textAppearance="?android:attr/textAppearanceLarge" android:text="Titre" android:id="@+id/textView" android:textStyle="bold" android:textSize="29sp" android:layout_weight="3" android:gravity="center" android:textColor="#ffffff" android:layout_marginTop="-2dp"/> <ImageButton android:layout_width="wrap_content" android:layout_height="28dp" android:id="@+id/imageButtoninformation" android:src="@drawable/icon_informations" android:background="#00000000" android:clickable="true" android:adjustViewBounds="true" android:scaleType="fitCenter" android:layout_weight="1" /> <ImageButton android:layout_width="wrap_content" android:layout_height="28dp" android:id="@+id/imageBoutique" android:src="@drawable/cocktail" android:background="#00000000" android:adjustViewBounds="true" android:scaleType="fitCenter" android:clickable="true" android:layout_weight="1"/> </LinearLayout> </RelativeLayout> le xml avec le DrawerLayout: <android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context=".MainActivityFragment" tools:openDrawer="start"> <include layout="@layout/main" android:layout_width="match_parent" android:layout_height="match_parent" /> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/relativeLayoutFavoris"> <TextView android:layout_width="match_parent" android:layout_height="20dp" android:text="Favoris" android:id="@+id/textViewFavoris" android:textSize="12sp" android:background="@drawable/contourcontact" android:gravity="left|center_vertical" android:layout_marginLeft="6dp" android:layout_marginTop="6dp" android:layout_marginRight="6dp" android:paddingLeft="6dp" android:textColor="#000000"/> <ImageView android:layout_width="14dp" android:layout_height="14dp" android:src="@drawable/star_icon" android:layout_marginEnd="20dp" android:layout_alignEnd="@+id/textViewFavoris" android:layout_alignBottom="@+id/textViewFavoris" android:layout_marginBottom="3dp"/> </RelativeLayout> </android.support.v4.widget.DrawerLayout> Ce que j’obtiens: Quote Link to comment Share on other sites More sharing options...
gob0 Posted November 22, 2015 Share Posted November 22, 2015 Salut, essayes de mettre la barre de titre dans le main.xml, entre RelativeLayout et LinearLayout Quote Link to comment Share on other sites More sharing options...
AceHomard Posted November 22, 2015 Author Share Posted November 22, 2015 Le linearLayout est ma barre de titre... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.