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.

Utilisation Styles impossible

Featured Replies

Posté(e)

EDIT : Le problème s'est résolu de lui-même lorsque j'ai fermé Eclipse :D

Je n'ai donc plus de problème

Bonjour,

Je viens de commencer le développement Android aujourd'hui et je fais déjà face à un problème que je n'arrive pas résoudre. Désolé donc si ma question est peut-être simple, mais je ne vois pas comment faire...

J'ai voulu employer des styles dans mon fichier main.xml. J'ai donc créé le fichier styles.xml que j'ai placé dans le dossier "values", et j'ai inséré ce code :

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Texte">
	<item name="android:gravity">center_vertical|center_horizontal</item>
	<item name="android:textSize">24dp</item>
</style>
</resources>

Ensuite, je suis retourné dans mon fichier main.xml et j'ai tenté de mettre le style en place :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
	android:layout_width="fill_parent"
	android:layout_height="wrap_content"
	style="@style/Texte"
	android:text="Blabla"
	 />
</LinearLayout>

Malheureusement, il ne fonctionne pas et je reçois l'erreur "Couldn't resolve resource @style/Texte"...

Quelqu'un aurait-il une idée d'où pourrait provenir le problème ? Merci d'avance :D

Modifié par 7804j

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.