MrEngineer13 / SnackBar

toast-like alert pattern for Android inspired by the Google Material Design Spec
Apache License 2.0
1.22k stars 174 forks source link

You must supply a layout_width attribute #92

Open Duna opened 4 years ago

Duna commented 4 years ago

Caused by: java.lang.UnsupportedOperationException: Binary XML file line #7: You must supply a layout_width attribute. at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:779) at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:8147) at android.view.ViewGroup$MarginLayoutParams.(ViewGroup.java:8339) at android.widget.FrameLayout$LayoutParams.(FrameLayout.java:439) at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:370) at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:56) at android.view.LayoutInflater.rInflate(LayoutInflater.java:865) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at com.github.mrengineer13.snackbar.SnackBar.(SnackBar.java:77) at com.github.mrengineer13.snackbar.SnackBar$Builder.(SnackBar.java:128) at com.million.duna.basefragments.FragmentGame$MyEventBus$3.run(FragmentGame.java:235)

MrDick-11 commented 1 year ago

got the same error. Any solution?

feihong247 commented 1 year ago

这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。

MrDick-11 commented 1 year ago

solved by copying sb_snack.xml to layouts and adding android:layout_width="match_parent" android:layout_height="match_parent"