Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Boutons "Confirmer" & "Annuler"

Featured Replies

Posté(e)

Bonjour tout le monde.

J'ai un petit problème dans un de mes fichiers XML. Il est structuré de la sorte : un RelativeLayout (avec divers TextView et EditText) englobé par un ScrollView.

J'ai deux boutons à la fin pour soit confirmer ou annuler (je les ai mis dans un LinearLayout pour utiliser layout_weight). J'aimerais que, sur les résolutions d'écran n'utilisant pas le ScrollView, ces deux boutons soient situés tout en bas de l'écran.

Voici un extrait de mon code :

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   >

 <RelativeLayout
  	android:layout_width="fill_parent"
	android:layout_height="wrap_content"
	>

//divers TextView et EditText

<LinearLayout 
	android:orientation="horizontal"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:layout_below="@id/etRemarqueGar"
	android:paddingTop="15dp"
	android:layout_alignParentBottom="true"
	>

		<Button 
			android:text="Confirmer" 
			android:id="@+id/btConfirmerGar" 
			android:layout_width="wrap_content" 
			android:layout_height="wrap_content"
			android:layout_weight="1"
			android:layout_alignParentBottom="true"
			></Button>

		<Button 
			android:id="@+id/btAnnulerGar" 
			  android:text="Annuler"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content" 
			android:layout_weight="1"
			/>
</LinearLayout>

</RelativeLayout>

</ScrollView>

Votre aide serait la bienvenue :emo_im_angel:

Si quelque chose n'est pas clair, n'hésitez pas à me demander des renseignements supplémentaires.

Modifié par Herrm

Posté(e)

Si tu met ton ScrollView et RelativeLayout en layout_height="fill_parent", ça ne fonctionne pas ?

Posté(e)

faut rajouter le positionnement.

perso j'ai fait

Un Frame Layout

----> LinearLayout

----> ScrollView

---->LinearLayout

-----> Linear layout

Et apres tu joue avec layout gravity.

Posté(e)
  • Auteur

Rebonjour, désolé pour la réponse tardive (j'étais en vacances! :) ) et merci pour les réponses!

Il suffisait en effet d'englober le tout dans un FrameLayout et d'ajouter le paramètre android:gravity="bottom" au LinearLayout contenant les deux boutons.

J'avais oublié l'existence de FrameLayout et son utilité...

Merci pour les réponses qui ne se sont pas faites attendre!

:)

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.