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.

Enfant d'un groupe d'un ExpandableListView et LayoutParams

Featured Replies

Posté(e)

Bonjour,

Lors du getChildView de mon ExpandableListAdapter je inflate une vue que je retourne

Or je me rend compte que ma vue ne remplie pas toute la largeur de l'ExpandableListView malgré le FILL_PARENT

J'essaye donc de forcer la vue en FILL_PARENT pour le width :

    public View getChildView(final int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
       View view = ViewGroup.inflate(mContext, R.layout.timeline_child_phone, 
...

               view.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));

       return view;
   }

Mais mon appli crash :

07-07 15:14:07.559: ERROR/AndroidRuntime(21405): Uncaught handler: thread main exiting due to uncaught exception
07-07 15:14:07.568: ERROR/AndroidRuntime(21405): java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.widget.ListView.measureScrapChild(ListView.java:1068)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1149)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.widget.ListView.onMeasure(ListView.java:1060)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.view.View.measure(View.java:7964)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.view.View.measure(View.java:7964)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.view.View.measure(View.java:7964)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.view.View.measure(View.java:7964)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.view.ViewRoot.performTraversals(ViewRoot.java:763)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.os.Looper.loop(Looper.java:123)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at android.app.ActivityThread.main(ActivityThread.java:4363)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at java.lang.reflect.Method.invokeNative(Native Method)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at java.lang.reflect.Method.invoke(Method.java:521)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-07 15:14:07.568: ERROR/AndroidRuntime(21405):     at dalvik.system.NativeStart.main(Native Method)

J'ai essayé avec ViewGroup.LayoutParams et FrameLayout.LayoutParams avec le même résultat crash

Le problème survient uniquement quand je spécifie un LayoutParams, ça fonctionne bien sans (mais ça ne remplie par horizontalement :/)

Modifié par Fluckysan

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.