2014-02-24 19 views
1

這是錯誤:Umano的SlidingUpPanelLayout:在XML有一個奇怪的錯誤,當我用它

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) 

起初我剛剛克隆了一個項目,直接到我的電腦。但是,由於我對它進行了更改,並希望使用github的應用程序將更改同步到它,我分叉並將其添加到我的項目中。自從在我使用它的XML文件中,我收到了這個錯誤。

最初我剛把項目直接克隆到我的電腦上。但是,由於我對它進行了更改,並希望使用github的應用程序將更改同步到它,我分叉並將其添加到我的項目中。自從在我使用它的XML文件中,我收到了這個錯誤。

編輯:增加了其餘的錯誤。我定義的layout_gravity像這樣:

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" > 

回答

1

我是啞巴

android:layout_gravity="bottom" 

實際上應該是

android:gravity="bottom" 
+0

我得到這個錯誤太多,但我實際上可以有第二重力 –

+0

NVM IM啞我不得不重建 –

+0

這將從我這裏得到一點,雖然:) –