Jump to content

Bar titre devant un drawer layout


AceHomard

Recommended Posts

Bonjour, je vais essayer de m'expliquer le mieux possible, je travaille sur Android studio et j'aimerais obtenir ceci:what%20i%20want.jpg

 

 

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.

Link to comment
Share on other sites

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:

device_23.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...