2016-04-19 4 views
1

Ich versuche, die AndroidSlidingUpPanel library (in Eclipse) zu verwenden, und ich habe diesen Fehler:Troubles mit AndroidSlidingUpPanel mit Eclipse - Fehler Inflating Klasse

04-19 20:09:48.413: E/AndroidRuntime(13760): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mendozatourapp/com.mendozatourapp.activitys.MapsActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class com.sothree.slidinguppanel.library.SlidingUpPanelLayout 

Das ist mein Layout ist:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".DemoActivity" > 

    <com.sothree.slidinguppanel.SlidingUpPanelLayout 
     xmlns:sothree="http://schemas.android.com/apk/lib/res-auto" 
     android:id="@+id/sliding_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="bottom" 
     sothree:panelHeight="68dp" 
     sothree:shadowHeight="4dp" 
     sothree:paralaxOffset="100dp" 
     sothree:dragView="@+id/name"> 
    </com.sothree.slidinguppanel.SlidingUpPanelLayout> 
</RelativeLayout> 

I lud das gesamte Projekt herunter und importierte "main" als Bibliothek. Dann füge ich diese Bibliothek dem Java-Buildpfad meines Projekts hinzu. Ich habe das Gefühl, dass dies ein Java Build Path Problem ist. Irgendeine Idee?

Vielen Dank für das Lesen und nehmen Sie sich Zeit, es zu tun.

+0

Sie müssen es in ein Bibliotheksprojekt für Eclipse machen. Haben Sie der Bibliothek eine Datei 'project.properties' und eine Datei' AndroidManifest.xml' hinzugefügt? –

+0

Ja, ich habe es getan. Vielen Dank. – flagg327

Antwort

1

Ich habe es gerade in Eclipse arbeiten.

Der wichtige Teil besteht darin, Ihr Bibliotheksprojekt korrekt zu erstellen und es dann mit Ihrem Hauptprojekt zu verknüpfen.

Für das Bibliotheksprojekt habe ich eine project.properties-Datei erstellt und außerdem die JAR-Dateien für die RecyclerView-Bibliothek, die Support-Bibliothek v4 und Neooldandroids hinzugefügt.

Ich habe auch eine .classpath-Datei erstellt, damit der java-Ordner automatisch in den Build-Pfad eingefügt wird.

ich hochgeladen das Bibliotheksprojekt, das ich github habe arbeiten: https://github.com/dmnugent80/SlidingUpPanel-for-Eclipse/tree/master

Dann das Bibliotheksprojekt in den Arbeitsbereich importieren:

enter image description here

Set es als Abhängigkeit des Hauptprojekts bis :

enter image description here

So beenden Sie oben w ith etwas wie folgt aus:

enter image description here

Dann wird mit diesen Test xml (Ihre xml warf einen Fehler über mindestens zwei Kinder benötigen):

<?xml version="1.0" encoding="utf-8"?> 
<com.sothree.slidinguppanel.SlidingUpPanelLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:sothree="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/sliding_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="bottom" 
    sothree:umanoPanelHeight="68dp" 
    sothree:umanoShadowHeight="4dp" 
    sothree:umanoParallaxOffset="100dp" 
    sothree:umanoDragView="@+id/dragView" 
    sothree:umanoOverlay="true" 
    sothree:umanoScrollableView="@+id/list"> 

    <!-- MAIN CONTENT --> 
    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 
     <TextView 
      android:id="@+id/main" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_marginTop="30dp" 
      android:gravity="center" 
      android:text="Main Content" 
      android:clickable="true" 
      android:focusable="false" 
      android:focusableInTouchMode="true" 
      android:textSize="16sp" /> 
    </FrameLayout> 

    <!-- SLIDING LAYOUT --> 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="#ffffff" 
     android:orientation="vertical" 
     android:clickable="true" 
     android:focusable="false" 
     android:id="@+id/dragView"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="68dp" 
      android:orientation="horizontal"> 

      <TextView 
       android:id="@+id/name" 
       android:layout_width="0dp" 
       android:layout_height="match_parent" 
       android:layout_weight="1" 
       android:textSize="14sp" 
       android:gravity="center_vertical" 
       android:paddingLeft="10dp"/> 

      <Button 
       android:id="@+id/follow" 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:textSize="14sp" 
       android:gravity="center_vertical|right" 
       android:paddingRight="10dp" 
       android:paddingLeft="10dp"/> 

     </LinearLayout> 

     <ListView 
      android:id="@+id/list" 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="1"> 
     </ListView> 
    </LinearLayout> 
</com.sothree.slidinguppanel.SlidingUpPanelLayout> 

Es funktioniert!

enter image description here

+1

Ich zitiere zu dir und ich bin sehr glücklich, es zu tun: "Es funktioniert!". Großartige Arbeit, Daniel. Ich danke dir sehr. – flagg327