Reputation: 2787
This is the error:
Exception raised during rendering: com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be instantiated:
- com.sothree.slidinguppanel.SlidingUpPanelLayout (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
java.lang.IllegalArgumentException: layout_gravity must be set to either top or bottom
at com.sothree.slidinguppanel.SlidingUpPanelLayout.<init>(SlidingUpPanelLayout.java:239)
at com.sothree.slidinguppanel.SlidingUpPanelLayout.<init>(SlidingUpPanelLayout.java:228)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:422)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:179)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:373)
Initially I had just cloned the project directly to my computer. But since I made changes to it and wanted to use github's app to sync changes to it, I forked it and added it to my project. Ever since in the XML file I use it in, I get this error.
Initially I had just cloned the project directly to my computer. But since I made changes to it and wanted to use github's app to sync changes to it, I forked it and added it to my project. Ever since in the XML file I use it in, I get this error.
edit: added rest of the error. I am defining the layout_gravity like so:
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/item_photo_pager_sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:background="@color/black"
sothree:collapsedHeight="32dp"
sothree:dragView="@+id/item_photo_pager_like_counter"
sothree:shadowHeight="4dp" >
Upvotes: 1
Views: 708
Reputation: 2787
I was dumb
android:layout_gravity="bottom"
should actually be
android:gravity="bottom"
Upvotes: 1