Sous android studio mes images s'affichent sous la taille d'un icone

Résolu/Fermé
rapidegoyes Messages postés 70 Date d'inscription samedi 22 février 2020 Statut Membre Dernière intervention 1 septembre 2023 - 9 juin 2021 à 23:44
rapidegoyes Messages postés 70 Date d'inscription samedi 22 février 2020 Statut Membre Dernière intervention 1 septembre 2023 - 10 juin 2021 à 23:24
Bonjour,

Je réalise une page avec android studio.
J'ai incorporé deux IMAGEVIEW qui recoivent chacun une image .png.
A l'affichage mon image est toute petite , sous la taille et forme d'un icone .
Elle n'occupe pas tout l'espace disponible.
C'est la première fois que j'ai ce problème , depuis la mise à jour de Android studio.

Voici mon code

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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:layout_width="match_parent"
android:layout_height="match_parent">


<TextView
android:id="@+id/titre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Gest_Débarras"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="#0000FF"
android:textSize="36sp"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/nomspingoing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/gestion_par_gus_et_pote"
android:textColor="#E91E63"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titre" />

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="100dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nomspingoing"
tools:srcCompat="@tools:sample/avatars" />

<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="60dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView"
tools:srcCompat="@tools:sample/avatars" />

<Button
android:id="@+id/bouton_ouvre_BDD"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:text="@string/acc_s_la_liste"
android:textColor="#9C27B0"
android:textSize="25sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2" />

</androidx.constraintlayout.widget.ConstraintLayout>


Merci de bien vouloir m'aider

cordialement
rapidegoyes




Configuration: Windows / Firefox 89.0
A voir également:

2 réponses

BunoCS Messages postés 15475 Date d'inscription lundi 11 juillet 2005 Statut Modérateur Dernière intervention 23 avril 2024 3 895
10 juin 2021 à 16:55
Hello,

Peut-être un problème dans tes contraintes ?
Quelle est la taille de tes images ? Je vois que tu utilises <code>wrap_content</content> donc l'imageView est censée prendre la taille de l'image
1
rapidegoyes Messages postés 70 Date d'inscription samedi 22 février 2020 Statut Membre Dernière intervention 1 septembre 2023 7
Modifié le 10 juin 2021 à 23:26
Bonsoir BunoCS

Merci une fois de plus tu me dépannes.
Effectivement c'était bien une histoire de taille d'image.
J'avais réduit l'image avec Paintnet dans le but de réduire l'impact sur la mémoire.

Encore merci et à +++
cordialement
rapidegoyes
0