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.

Position dans un LinearLayout

Featured Replies

Posté(e)

Je cherche à faire un truc tout simple :

Afficher sur une ligne (horizontalement) un texte et un bouton.

Le texte est collé à gauche de l'écran.

Le bouton est collé à droite de l'écran.

L'espace au milieu est vide.

Si jamais l'écran est trop petit, le texte doit pouvoir passer à la ligne tout seul.

pour le moment j'ai ça :

               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:orientation="horizontal">
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:text="@string/texte_tres_long" />
                   android:layout_width="0dip"
                   android:layout_height="wrap_content"
                   android:layout_weight="1" />
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:enabled="false" />

Ca marche bien, sauf si le texte est trop long :

le texte "pousse" le bouton en dehors de l'écran.

Le bouton est donc à moitié visible :(

Et le texte ne revient pas à la ligne tout seul !!!

Je me plante de Layout ?

Je l'utilise mal ?

Merci

Modifié par Pierre87

Posté(e)
  • Auteur

en fait, il suffit de dire au texte de prendre toute la place disponible, avec un layout_width à 0dip et layout_weight à 1

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.